-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): [prefer-null-coal] opt for suggestion fixer #1272
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
Conversation
Thanks for the PR, @bradzacher! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
Codecov Report
@@ Coverage Diff @@
## master #1272 +/- ##
==========================================
+ Coverage 94.06% 94.06% +<.01%
==========================================
Files 131 131
Lines 5745 5746 +1
Branches 1617 1619 +2
==========================================
+ Hits 5404 5405 +1
Misses 183 183
Partials 158 158
|
Can this be used to make ESLint not report an error in those cases? I'm not sure how just changing the suggestion type would help with adoption, if it still fails CI... |
Converting it to a suggestion fixer only means that it won't auto-fix and introduce breakages. The idea would be that you'd set the rule to a warning (which shouldn't block your CI; if your warnings and errors both block CI, then why have warnings?), and progressively update your codebase to remove the warnings. As mentioned on the linked issue, adding an option to not check falsey types makes the rule pretty well useless, as it would only check |
That is still very useful on a large team where many people don't know the latest features. It means that no new cases can be introduced, and when someone writes them in their editor, they can be directly automatically converted to the more precise form on save. |
Fixes #1265
Adding an option to force the rule to only use suggestions.
This should help with users migrating existing codebases.