We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
prefer-nullish-coalescing
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator
https://github.com/tc39/proposal-nullish-coalescing
let foo = (undefined || null) || bar; // equals let foo = (undefined || null) ?? bar;
anyway, it not safe for foo || bar -> foo ?? bar, we should use ESLint suggestion api
foo || bar
foo ?? bar
The text was updated successfully, but these errors were encountered:
For inspiration: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
This obviously has to wait until ESLint supports ??.
??
Sorry, something went wrong.
Support for nullish coalescing operator was added in ESLint 7.2.0.
This is now accepted. PR welcome.
If anyone wants to work on this, see the initial attempt and feedback in #1388.
fisker
Successfully merging a pull request may close this issue.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator
https://github.com/tc39/proposal-nullish-coalescing
anyway, it not safe for
foo || bar
->foo ?? bar
, we should use ESLint suggestion apiThe text was updated successfully, but these errors were encountered: