I am trying to auto-fix issues in my js file using
eslint --fix -c "/path/to/.eslintrc" <file-name.js>
but with no success. Went through Eslint Rules . I have to fix "no-undef" & "no-unused-vars" using the command, but it still not works.
ESLint --fix
will fix everything that it fix, but in many cases won't be able to automatically follow every rule. 修复的所有内容,但在许多情况下无法自动遵循每条规则。
Rules that can be taken care of with --fix
can be found in the rules documentation - they'll have a wrench icon next to the rule name.
Looks like the no-undef
and no-unused-vars
rules don't, so you'll have to manually comb through the warnings and manually modify the code.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.