-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Array.filter accepts any #20033
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
Comments
This was changed in #7779. But it seems like if developers want that behavior we should just have a flag to make In It's not really possible for a lint rule to check this kind of situation because the signature of the function doesn't indicate that the value is meant to be a boolean. So it seems like the correct solution is to write declaration files with specific types and allow users to have more loose behavior. |
The flag sounds like an interesting idea. Would it affect all the instances of |
I'm a little uneasy about a global flag that changes the behaviour of all Maybe a new type ( Re: @thorn0: I don't think we want to allow |
Duplicate of #19456 |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
TypeScript Version: 2.7.0-dev.20171114
Code
Expected behavior:
All are errors.
Actual behavior:
The callback passed to
filter
is not type checked.The text was updated successfully, but these errors were encountered: