Closed sharmilajesupaul closed 3 years ago
Welcome! 👋
Thanks you for creating the issue. 🙌 I will come back to this as soon as possible.
Also happy to submit a PR if you'll accept it! Thanks!
It might also be worth considering removing autofix entirely, or making it explicitly opt-in instead of opt-out, since it is likely unsafe to autofix this in general.
Thanks for the suggestions - very much appreciated!
Just released v2.1.0 that switched autofix
to opt-in.
I love the idea of this plugin, thank you for making it.
We want to use this rule at Airbnb but there are several cases where auto-fixing problems might not be safe. So we'd like to option to disable the auto-fix if possible.
Some examples are non-inclusive terms that may be a part of API calls or rely on references outside of a given file such as named imports. Since we recommend enabling auto-fixing on save in editors, an engineer could save a file and unintentionally introduce bugs due to the result of an autofix.
For example:
If the rule defined config is:
a named import from a module like this:
will be fixed to:
Similarly, API request code that might look like:
will be fixed to:
In both of these cases, the resulting code from the autofix might introduce bugs. Could we add a configuration option like
"autofix": false
that we can use to disable the autofix on this rule?