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
However, upon save, this warning is not autofixed. Additionally, there is no "quick fix" shown in vscode as there would be for other fixable errors.
This warning is autofixable at command line by eslint using the --fix flag.
I have found that if there are other errors in the file then upon save both the other error as well as the unused directive will be autofixed. Additionally, if I choose the quick fix "Fix all auto-fixable problems" for the other error, it will automatically fix the unused directive. It appears that automatic fixing will only not occur if this is the only problem in the file.
It's possible I'm missing a configuration somewhere that would allow this to be fixed and if that is the case would appreciate guidance on how to configure it. If that is not the case then please consider a feature request to the extension to treat this as a fixable error.
Thanks!
The text was updated successfully, but these errors were encountered:
I debugged this a bit and the issue is that ESLint does not assign a ruleId to disable directive reports, and this extension uses that ID for generating items for the "quick fix" menu:
In my eslint config, I've got the following activated:
This causes eslint to emit a warning for unused disable directives and it properly shows as a warning in vscode:
In my vscode settings I've got code actions on save enabled:
However, upon save, this warning is not autofixed. Additionally, there is no "quick fix" shown in vscode as there would be for other fixable errors.
This warning is autofixable at command line by eslint using the
--fix
flag.I have found that if there are other errors in the file then upon save both the other error as well as the unused directive will be autofixed. Additionally, if I choose the quick fix "Fix all auto-fixable problems" for the other error, it will automatically fix the unused directive. It appears that automatic fixing will only not occur if this is the only problem in the file.
It's possible I'm missing a configuration somewhere that would allow this to be fixed and if that is the case would appreciate guidance on how to configure it. If that is not the case then please consider a feature request to the extension to treat this as a fixable error.
Thanks!
The text was updated successfully, but these errors were encountered: