require('shelljs');

const FIX = process.env.FIX ? '-- --fix' : '';
const silent = true;

const modifiedFiles = exec('git diff-index --name-only HEAD', { silent })
  .grep(/\.js$/)
  .stdout
  .split(/[\n\r]/)
  .filter(path => path.startsWith('src/'))
  .join(' ');

const result = exec(`npm run lint ${FIX} ${modifiedFiles}`, { silent });

if (result.code) {
  echo(result.stdout);
  exit(result.code);
}

@@ -166,16 +166,24 @@
  .grep(/
+%5Esrc%5C/.+
 %5C.js$/)%0A

Check only files from src folder with eslint on pre-commit