Skip to content

Instantly share code, notes, and snippets.

@ronapelbaum
Created May 4, 2017 05:50
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ronapelbaum/ef3c3459f01b002d0d719ca205401174 to your computer and use it in GitHub Desktop.
Save ronapelbaum/ef3c3459f01b002d0d719ca205401174 to your computer and use it in GitHub Desktop.
How to run ESLint in you travis CI
language: node_js
node_js:
- "6"
script:
- npm run lint
- npm run build
- npm test
{
...
"scripts": {
"lint": "./node_modules/.bin/eslint **/*.js",
"build": "...",
"test": "..."
}
...
}
@GrayedFox
Copy link

GrayedFox commented Mar 2, 2018

That linting glob pattern didn't work for me (Ubuntu 16.04 LTS), however the following did:

  "scripts": {
    "lint": "./node_modules/.bin/eslint . ./**/*.js"
  }

Cheers for the gist however!

@mysterycommand
Copy link

This is old now, but just FYI you need quotes around the glob for it to work, also since you're calling this through npm run it doesn't need the ./node_modules/.bin:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment