ESLint: 5.0.1 Error

eslint rules
eslint: command not found
eslint ignore
eslint react
eslint plugins
eslint --fix
eslint warning instead of error
eslint no-error-on-unmatched-pattern

I'm creating a project following this tutorial: Full Stack Web App using Vue.js & Express.js: Part 1 - Intro

I ran the next command: "npm start" which was configured in my package.json like this:

"scripts": {
        "start": "./node_modules/nodemon/bin/nodemon.js src/app.js --exec 'npm run lint && node'",
        "lint": "./node_modules/.bin/eslint **/*.js"
      },

But ESLint throws the next error:

Oops! Something went wrong! :(

ESLint: 5.0.1. No files matching the pattern "node_modules/ipaddr.js" were found. Please check for typing mistakes in the pattern.

npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! server@1.0.0 lint: `eslint **/*.js` npm ERR! Exit status 2 npm ERR!  npm ERR! Failed at the server@1.0.0 lint script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR!     /home/ironman/.npm/_logs/2018-06-26T13_45_13_295Z-debug.log [nodemon] process failed, unhandled exit code (2) [nodemon] Error
    at Bus.utils.bus.on (/home/ironman/Documentos/Sandbox/Vuexpress/server/node_modules/nodemon/lib/nodemon.js:148:25)
    at Bus.emit (events.js:187:15)
    at ChildProcess.<anonymous> (/home/ironman/Documentos/Sandbox/Vuexpress/server/node_modules/nodemon/lib/monitor/run.js:164:11)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)

I know there is another thread asked yesterday but i can't comment on it unless i have 50 reputation. Also, joknawe points out that maybe eslint is trying to lint my node_modules directory but i don't know how to ignore it.

Is there any way to solve this issue ?

Below worked:

// Pass on both Windows & Ubuntu.  
// Note the slash & double quotes

// File: package.json:  

"scripts": {
  "lint": "eslint \"./**/*.js\"",
}

Below didn't work, on one of the OS:

// Windows - Fail -  "Oops! Something went wrong! :("  
// Note the single quotes

"lint": "eslint './**/*.js'",


// Ubuntu - Fail
// Note no quotes

"lint": "eslint ./**/*.js",

Hope that helps.

eslint, "error" or 2 - turn the rule on as an error (exit code will be 1). The three error levels allow you fine-grained control over how ESLint applies rules (for more  The fix that worked for me was installing the babel-eslint package (npm install babel-eslint --save-dev or yarn add babel-eslint -D). I then added "parser": "babel-eslint" to my .eslintrc config file. This seems to help babel and ESLint get along a little better than using the default parser.

I've solved the exact same issue by changing

"lint": "./node_modules/.bin/eslint **/*.js"

to

"lint": "./node_modules/.bin/eslint src/*.js"

Hope this help.

Cannot find module 'eslint-config-airbnb' and/or 'eslint-plugin-react , Cannot read config package: eslint-config-airbnb Error: Cannot find module '​eslint-config-airbnb' Referenced from: long_path.eslintrc C Tell us about your environment ESLint Version: v4.19.1 Node Version: v9.10.0 npm Version: v5.6.0 What parser (default, Babel-ESLint, etc.) are you using? Regular ESLint Please show your full config

I had the same issue. Worked fine under Windows, but failed during build-job (Ubuntu). Quote the pattern and it works fine as in previous versions of eslint

"lint": "./node_modules/.bin/eslint \"**/*.js\""

Credit goes to https://github.com/eslint/eslint/issues/10599

Error when installing eslint globally · Issue #745 · facebook/create , I got the following error when trying to install eslint globally (as suggested in the user guide):  @evaristoc eslint-plugin-react is not a dependency of linter-eslint.If you need that plugin in your project you should install a local version of eslint with that plugin in your project.

Package, The three error levels allow you fine-grained control over how ESLint applies rules (for A bug fix to the CLI or core (including formatters). 2 years ago; 5.0.1 . Tell us about your environment Environment Info: Node version: v10.16.3 npm version: v6.11.3 Local ESLint version: v6.5.1 (Currently used) Global ESLint version: Not found typescript-eslint/parser Please show your full configuration: { "

Migrating to v5.0.0 - ESLint, ESLint v5 will report a fatal error when either of the following conditions is met: A file provided on the command line does not exist; A glob or folder provided on the​  Your application will need to depend on it explicitly. eslint-config-airbnb-base@5.0.1 /usr/local/lib/node_modules/eslint-config-airbnb-base Again, you can ignore any “npm WARN” messages. If you get “npm ERROR”, that’s a problem that needs to be solved.

Migrating to v6.0.0 - ESLint, Plugin authors may need to update installation instructions; RuleTester now To catch config errors earlier, ESLint v6 will report a linting error if you are trying to  Configuring ESLint. ESLint is designed to be completely configurable, meaning you can turn off every rule and run only with basic syntax validation, or mix and match the bundled rules and your custom rules to make ESLint perfect for your project.

Comments
  • Create an eslint ignore file: stackoverflow.com/a/46947250/977192
  • I've created that file ignoring "/node_modules" but it does not work.
  • @karllhughes that does not work on eslint v5
  • @EnriqueBermúdez, did you solve the issue in the end? Could you complete the tutorial?