-
Notifications
You must be signed in to change notification settings - Fork 53
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
ESLint: Set "no-unnecessary-condition" rule to error #2755
Conversation
My IDE is clever, I'm usually not (especially when I copy over a part of the code). Let's add a new rule to make our linting tighter. |
939a998
to
34537e1
Compare
21e881c
to
80bb886
Compare
Originally added all autofix changes, but those break the service. We're combining optional chaining and type assertion in some cases. Meaning we ignore the possibility of |
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## main #2755 +/- ##
=======================================
Coverage 84.66% 84.66%
=======================================
Files 186 186
Lines 20996 20996
Branches 2033 2033
=======================================
Hits 17777 17777
Misses 3197 3197
Partials 22 22 Continue to review full report in Codecov by Sentry.
|
ee510cd
to
3dc2e0c
Compare
This adds "no-unnecessary-condition" and sets the output to warn. This should help us eliminate superfluous conditional chaining and uncover potentially faulty conditions. Docs: https://typescript-eslint.io/rules/no-unnecessary-condition/
3dc2e0c
to
fb0248e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it! This is going to really help the review process - one less thing to look for!
Hard disagree on the second part 😉 |
This adds "no-unnecessary-condition" and sets the output to error. This should help us eliminate superfluous conditional chaining and uncover potentially faulty conditions.
Docs: https://typescript-eslint.io/rules/no-unnecessary-condition/