-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: migrate jest-validate to TypeScript #7991
Conversation
6624022
to
1cbc3fd
Compare
1cbc3fd
to
55e7ed8
Compare
import {multipleValidOptions} from 'jest-validate'; | ||
import {NODE_MODULES} from './constants'; | ||
|
||
const NODE_MODULES_REGEXP = replacePathSepForRegex(NODE_MODULES); | ||
|
||
const initialOptions: Config.InitialOptions = { | ||
automock: false, | ||
// @ts-ignore TODO: type this properly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeysal do you know how to type this? Essentially, the return-type should be one a union of the types of all arguments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand, wouldn't that typing be a lie? multipleValidOptions
doesn't return one of the argument (in that case the return type would be the union of them), but an array of all of them.
|
||
// @ts-ignore: not the same arguments | ||
// @ts-ignore: fix this at some point | ||
validateCLIOptions(argv, {...args.options, deprecationEntries}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error here is nuts, I gave up :p
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This is not good enough for external consumers of
jest-validate
, but it works for our internal usage, which is better than nothing 🙂 Help making it better is greatly appreciated!Built diff:
Test plan
Green CI