javascripteslinteslintrc

Enable eslint only for edited files


Recently, I configured eslint one of my projects. This project was consisting of hundreds of files, as soon as I configured eslint starts showing errors in all files.

IMO, eslint traverses through all js files, which is not required currently. Is there any way we can limit eslint only for edited files?


Solution

  • eslint --fix $(git diff --name-only HEAD | xargs)