Option to not auto fix
sirmspencer opened this issue · 3 comments
Features:
I really like this rule for marking unused imports. However, sometimes I save with imports I know I will need, or comment out a block of code for testing that is the only location using an import. It would be great to leave this a warning for a PR, but not auto fix while working on a problem.
Nevermind. Other lint rules will highlight the import without removing.
@sirmspencer Could you elaborate on how you got it to highlight only and not remove the unused imports? I too sometimes comment out code while debugging, only to have to manually add an import back when I uncomment that code again.
I thought I could just add "unused-imports/no-unused-imports": "warn"
as a rule, but ESlint is already warning me that 'Definition for rule 'unused-imports/no-unused-imports' was not found, so I'm not really sure what is doing the autofixing.
From my .eslintrc.js
:
extends: ['airbnb-base', 'prettier'],
plugins: ['prettier'],
"no-unused-vars" also checks imports.