I am running npm run lint -- --fix
from command line to automatically fix lint errors, but this command creates fixes on the entire project.
I've been searching the documentation to find out how to run the automatic fix on a specific file instead of the entire project, but I couldn't find a way.
Is this possible?
Using ESLint from the CLI should fix it:
eslint --fix "C:\code\hello-world.js"
ESLint CLI documentation
The solution works great, this is just a quick tip for yarn/mac users:
yarn eslint --fix "src/ui/screens/HelloWorld.js"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With