Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I havesearched for related issues and found none that match my proposal.
- I have searched thecurrent rule list and found no rules that match my proposal.
- I haveread the FAQ and my problem is not listed.
Relevant Package
utils
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Description
OurESLintUtils.RuleCreator
function's parameter includes arecommended
property. Relative to#5251:
- Previously, that was
recommended: 'error' | 'strict' | 'warn' | false
property. - In that PR it became optional,
recommended?: 'recommended' | 'strict' | 'stylistic'
.
Having it optional is nicer for users because they don't have to provide one. Many users writing custom rules don't care about therecommended
property. They might be writing one-of rules for a single repo, or for configs that they always configure in roughly the same way(s). No need for a recommendation.
But for users who are writing very reusable rules thatshould have arecommended
property, they're still locked into using our'recommended' | 'strict' | 'stylistic'
type. Which might not correspond to how they organize their rule recommendations.
@bradzacher suggested inhttps://github.com/typescript-eslint/typescript-eslint/pull/5251/files#r1103977719:
Do we want to make this a generic and just make it default to the old value?
In our createRule function we can overwrite it with our own type so we only do this locally.
I like that strategy!
Additional Info
I don't 100% have a code example to suggest here. A bit of investigation required. 😉