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
Add prefer-nullish-coalescing
rule
#1388
Conversation
After excluding many possible boolean values, there still false positive, because we can't know the |
Is this even safely possible without types? |
It's not safe, as you can see the changes, I was thinking maybe we can set this rule to There are same concerns in the ESLint issue eslint/eslint#14037, and I don't think they will accept it. I've already used this rule at my work with I'm also trying to reduce false positives, I've excluded many cases with boolean value on the left, see this commit. |
Unless the user disables warnings, warnings are still noisy enough that makes people wary of using |
That's all I got in mind. |
I think this rule would be useful as something I would run once-in-a-while to catch cases where I forgot to use Alternatively, it would use type information when available: #347 |
Closing for lack of activity. |
Fixes #471