Enhancement: Consider making custom rule 'recommended' field generic #6467
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
enhancement
New feature or request
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: utils
Issues related to the @typescript-eslint/utils package
Uh oh!
There was an error while loading. Please reload this page.
Before You File a Proposal Please Confirm You Have Done The Following...
Relevant Package
utils
My proposal is suitable for this project
Description
Our
ESLintUtils.RuleCreator
function's parameter includes arecommended
property. Relative to #5251:recommended: 'error' | 'strict' | 'warn' | false
property.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 the
recommended
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 that should have a
recommended
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 in https://github.com/typescript-eslint/typescript-eslint/pull/5251/files#r1103977719:
I like that strategy!
Additional Info
I don't 100% have a code example to suggest here. A bit of investigation required. 😉
The text was updated successfully, but these errors were encountered: