Configs: Have recommended/strict configs include lesser configs, and simplify type checked names #6019
Replies: 2 comments 6 replies
-
Could I suggest a change? Is it possible we could get a I'd love to extend the I know it's a separate request, but I wanted to mention it here first since it's in direct opposition to half of this change. |
Beta Was this translation helpful? Give feedback.
-
I definitely agree that splitting out So i think it might make sense to continue this theme for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Edited December 8th, 2022: updated to include @aaronadamsCA's #6019 (comment) and @robertknight's #6014 (comment) to this proposal.
Context
Right now, no config in the following list of configs provided with typescript-eslint includes any other config in that list:
plugin:@typescript-eslint/recommended
plugin:@typescript-eslint/recommended-requiring-type-checking
plugin:@typescript-eslint/strict
That means if you want, say, the strictest, you must enable all three (https://typescript-eslint.io/docs/linting/configs):
That's very inconvenient -and sometimes even confusing- for end users.
Breaking Change: Including Lesser Configs
Proposal: how about we have each config in that list also include any previous config in the list? That way if you want, say, the
strict
ruleset, you would only need to enable it, notrecommended-*
ones:Associated Enhancement: More Delineated Configs
We've received occasional user feedback (e.g. #6014 (comment)) that our recommended rulesets also include some stylistic rules. The ESLint community has generally moved away from the old 2010s-era eslint-config-airbnb practice of doing that. I agree that we should separate those out.
This proposal suggests we split our recommended configurations into:
recommended
: Recommended rules that you can drop in without additional configuration.recommended-type-checked
: Additional recommended rules that require type information.strict
: Additional strict rules that can also catch bugs but are more opinionated than recommended rules.strict-type-checked
: Additional strict rules require type information.stylistic
: Stylistic rules you can drop in without additional configuration.stylistic-type-checked
: Additional stylistic rules that require type information.You can see the equivalent code changes in #5251.
Description of Breaking Changes
In other words, there are three changes being proposed here:
recommended
,recommended-requiring-type-checking
, andstrict
configs: this is a breaking changestrict-type-checked
,sylistic
, andstylistic-type-checked
configurations: this is not a breaking changerecommended-requiring-type-checking
torecommended-type-checked
: this would be a breaking change, exceptrecommended-requiring-type-checking
, will be left as an alias for its new config name,recommended-type-checked
.Thanks @shawnmcknight for a great Twitter discussion on phrasing the breaking changes!
Beta Was this translation helpful? Give feedback.
All reactions