Automatically fix lint problems only on a specific file

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?

1 Answer

Using ESLint from the CLI should fix it:

eslint --fix "C:\code\hello-world.js" 

ESLint CLI documentation

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like