-
Notifications
You must be signed in to change notification settings - Fork 60
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 additional lint rules from typescript-eslint and eslint-plugin-unicorn #3557
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3557 +/- ##
==========================================
+ Coverage 62.55% 62.70% +0.15%
==========================================
Files 866 864 -2
Lines 30324 30224 -100
Branches 7280 7266 -14
==========================================
- Hits 18969 18952 -17
+ Misses 11165 11081 -84
- Partials 190 191 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
9f06dfa
to
3a8b4a0
Compare
should be ready to go. has actually low amount of conflicts with e.g. #3503 |
This PR enables @typescript-eslint recommend-types-required rules and eslint-plugin-unicorn recommended rules https://github.com/sindresorhus/eslint-plugin-unicorn
It uses recommended lists, and then turns off a good amount of them. This way, if recommended gets upgraded in the future, we can get these updates, and we can re-enable some of our disabled over time if we see fit to.
The unicorn rules are a little eccentric but actually have some good fixes (avoids accidentally quadratic usages of includes instead of has on a Set for example). other interesting rules in unicorn include forbidding Array reduce, as it generally produces more confusing code. I'd have to say, this is probably true, so I converted some usages of array reduce
Similarly, the recommended-types-required has many rules that are good in nature, but need disabling for practical purposes for now (we have lots of type any, and can't avoid it in some cases)
Also changes most of our ts-ignore to ts-expect-error, so that if they get fixed somehow, they are no longer ignored