Enhancement: [ban-types] Add suggest
option to types
#6875
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
enhancement: plugin rule option
New rule option for an existing eslint-plugin rule
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Proposal Please Confirm You Have Done The Following...
My proposal is suitable for this project
Link to the rule's documentation
https://typescript-eslint.io/rules/ban-types
Description
Sometimes a banned type can support an autofix, but you'd prefer to pass an array of potential replacements rather than one autofix.
Updating the
Types
option to:{ message: string; fixWith?: string; + suggest?: readonly string[]; }
would allow for replacements to be show as ESLint suggestions.
This would also allow the default
Object
and{}
banned types to use suggestions.Fail
Pass
Additional Info
No response
The text was updated successfully, but these errors were encountered: