-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin)!: recommended-requiring-type-checking config #846
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, @JamesHenry! 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 |
BREAKING CHANGE: removed some rules from recommended config
fe15245
to
b52298a
Compare
Codecov Report
@@ Coverage Diff @@
## master #846 +/- ##
==========================================
+ Coverage 94.19% 94.19% +<.01%
==========================================
Files 112 112
Lines 4825 4826 +1
Branches 1338 1338
==========================================
+ Hits 4545 4546 +1
Misses 160 160
Partials 120 120
|
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.
Awesome! Everything LGTM!
Two suggestions and then I think this can be merged for the full 2.0 release 🎉 :
Probs should update the configs readme with the new config.
We could potentially delete it, or merge your root plugin readme changes into there?
If we want to keep it, then maybe add a link from the root plugin readme to it so that people can find it easier?
Would be awesome if you could update the doc validator so it supports the new prop you added. Might be a good idea to use this to validate that the boolean flag is set correctly.
(this change would handle your TODO comment)
typescript-eslint/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts
Lines 103 to 114 in 90b36dd
// quick-and-dirty check to see if it uses parserServices | |
// not perfect but should be good enough | |
const ruleFileContents = fs.readFileSync( | |
path.resolve(__dirname, `../../src/rules/${ruleName}.ts`), | |
); | |
const usesTypeInformation = ruleFileContents.includes('getParserServices'); | |
validateTableBoolean( | |
usesTypeInformation, | |
rowNeedsTypeInfo, | |
':thought_balloon:', | |
'requiring type information', | |
); |
I.e.
if (ruleFileContents.includes('getParserServices')) {
enforce that requiresTypeChecking === true
table row should have the :thought_balloon:
} else {
enforce that requiresTypeChecking === false
table row should not have the :thought_balloon:
}
Co-Authored-By: Brad Zacher <brad.zacher@gmail.com>
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.
LGTM! Awesome
BREAKING CHANGE: removed some rules from recommended config
recommended-requiring-type-checking config
recommended
config not including rules which require type-checking (it would throw if any of the rules required a program)P.S. TODO in follow up (lower priority because integration test will catch the violations that matter), add some kind of check (maybe we should create a new package for lint rules which only apply to the monorepo and which we don't publish?) to ensure that we correctly mark rules requiring type-checking with
requiresTypeChecking: true
.