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
no-useless-undefined
: undefined
removed from jest function matchers
#807
Comments
I'd say you better disable the rule in that case. Generally, there are always cases where explicit > new Date()
2020-08-25T07:28:34.351Z
> new Date(undefined)
Invalid Date |
Maybe the rule could be automatically disabled for files in which the 'jest' environment is enabled? |
The issue has nothing to do with jest. Any function that checks the length of its arguments or is implemtend in native code like the |
I know, but it would be a way to at least lower the amount of false-positives. I agree that false positives would still exist. |
Yap, the simplest way to fix this is add this name to that list. |
If this issue is about If it's about |
Essentially it's a unsolvable problem but I guess a allowlist of common usages of |
What do you prefer?
Or better solution? |
Neither, I would personally just put a |
The changes made in #758 were to add the missing cases to allow-list,so adding a configurable list might be useful for new checker aliases or test runners too. |
This is breaking as jest toHaveBeenCalledWith (and other similar matchers) explicitly checks for nth argument to be undefined
Would be better if this rule would accept and array of "acceptable" functions that have undefined?
The text was updated successfully, but these errors were encountered: