ESLint producing different output when run with npm run-script

Globs work differently in the package.json file.

The trick is to wrap the path matchers in single quotes to have them expanded at the shell level before they're passed to eslint.

// package.json
// ...
"scripts": {
  "lint": "eslint 'scripts/**/*.js'"
}
// ...

Sounds like David's answer solved the problem he was encountering. However, I had an identical symptom to the problem described.

In my case the problem was that npm was using the node_modules in the project directory which had a different version of the plugin than the global npm folder had.

Running eslint from command line was using the global version. Reconciling those versions resolved the issue in my case.

Tags:

Npm

Eslint