You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users have asked several times for a way to disable a rule fix or to upgrade a rule fix from unsafe to safe. Some users would also like a way to downgrade a fix from safe to unsafe.
Disabling a code fix is particularly useful if a user encounters a bug with the code fix.
The user can then disable the rule and continue to use --apply/--apply-unsafe.
Upgrading a code fix to safe has the advantage of allowing users to automatically fix a rule in an IDE.
Conversely, downgrading a rule allows you to disable auto-fixing in the IDE.
I propose to add a new field fix to each rule configuration. fix will take a value among safe, unsafe and none.
If the field is not set, then the default fix kind is the kind declared in the rule.
This field has no effect for rules without a code fix. Ideally we should output an error for such rules.
Here is an example, where we disable the code fix of noUnusedVariables, where we downgrade the code fix useConst of and upgrade the code fix of useTemplate
Description
Users have asked several times for a way to disable a rule fix or to upgrade a rule fix from
unsafe
tosafe
. Some users would also like a way to downgrade a fix fromsafe
tounsafe
.Disabling a code fix is particularly useful if a user encounters a bug with the code fix.
The user can then disable the rule and continue to use
--apply
/--apply-unsafe
.Upgrading a code fix to
safe
has the advantage of allowing users to automatically fix a rule in an IDE.Conversely, downgrading a rule allows you to disable auto-fixing in the IDE.
I propose to add a new field
fix
to each rule configuration.fix
will take a value amongsafe
,unsafe
andnone
.If the field is not set, then the default fix kind is the kind declared in the rule.
This field has no effect for rules without a code fix. Ideally we should output an error for such rules.
Here is an example, where we disable the code fix of
noUnusedVariables
, where we downgrade the code fixuseConst
of and upgrade the code fix ofuseTemplate
The text was updated successfully, but these errors were encountered: