How do I integrate eslint with my Meteor package? I’ve never come across any Meteor packages with a .eslintrc
file in them.
Run the following:
$ npm i --save-dev babel-eslint eslint
Add this to your package.json
file:
"scripts": {
"lint": "eslint ."
}
And then run npm run lint
and it should work!
The Check your code with ESLint section of the guide pretty much spells it out. As @ffxsam points out, the guidance there is to put the configuration in package.json. It may also be placed in .eslintrc.json. The latter might have an advantage in that ESLint tolerates js style comments in .eslintrc.json.
You actually have tons of file format options (JSON, YAML, JS), but .eslintrc
is the standard.
PS, eslint 3.0 was just recently released.
Note that eslint 3 dropped node < 4 support and thus needs Meteor 1.4.
Well, it depends. eslint is in no way tied to Meteor. So for those who use npm
vs meteor npm
, eslint 3 will work just fine.