-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: use typescript-eslint's recommended-requiring-type-checking #1035
Comments
Thanks for opening the issue. This sounds great overall. There are a few strict settings that don't make sense to me in certain projects (for example banning non-null assertions, when the only place you were ever going to use them is places where you'll still use them anyway but now with two lines of comments above to allow it) but overall I'm strongly in favor of it, and I could probably have my mind changed about any of the ones that I don't love. If you're up for it, could you make a PR of an implementation with you proposed rule set so we can see both how many changes it requires for a stock app, and what it looks like with a "dirty" existing project? By the way, would this also make sense for the CLI? |
Yeah 😞 If you have any input on the recommended rulesets there, I'd love to hear it. We're going to publish that suggestion list out soon for community feedback.
Is #1036 what you're looking for? By "dirty" existing project do you have a particular one in mind? I'm not sure I follow.
I think so - if you mean https://github.com/t3-oss/create-t3-app/blob/d38c78624d502e648eeb80bc595bbc9c3c686f1e/cli/template/base/.eslintrc.json? |
Yes, that's great! By a "dirty" project I just meant pasting these rules into an existing codebase where they weren't being used, and seeing how much if any existing code is flagged by the rules. I gave this a try, and it seems good to me. |
Is your feature request related to a problem? Please describe.
https://github.com/t3-oss/create-t3-app/blob/88ce6e50289281e009f1eea2223dbef4cb86df61/cli/template/base/.eslintrc.json right now extends from
plugin:@typescript-eslint/recommended
. But per typescript-eslint.io's docs on typed linting there's actually a second recommended ruleset that can be enabled:plugin:@typescript-eslint/recommended-requiring-type-checking
(RRTC).The RRTC config isn't enabled by default because typed linting comes with some performance drawbacks. But it includes many of the particularly powerful rules in typescript-eslint. See https://typescript-eslint.io/rules for a full list.
Describe the solution you'd like to see
trpc/trpc#3482 is a pretty good reference point:
"plugin:@typescript-eslint/recommended-requiring-type-checking"
to theextends
in the ESLint config filetsconfig.eslint.json
extend fromtsconfig.json
, to pull in relevant compiler optionsDescribe alternate solutions
Going without the fancier, stronger rules, I suppose? 🤔
Additional information
See #317 for typescript-eslint's introduction.
The text was updated successfully, but these errors were encountered: