@awatson1978 recommended atom-jshintin her meteor-api pkg write-up (thanks for the awesome pkg and info), but both atom-jshint and jshint seem to be dormant and looking for maintainers.
The original authors of those pkgs both said they were moving on in favor of ESLint…ok, so I checked out the eslint atom package and of course, abandoned long ago and doesn’t even install to the current atom 1.3.1.
Seems like jshint works just fine but boy do I hate those errors I get for every single missing semi-colon!
What do you use (if anything) to lint your ES2015?
We’re going to recommend a standard es2015 eslint config based on the Airbnb style guide soon. Unfortunately it will still complain about semicolons, but you can turn that off in the configuration.
While it is nice to run the linter from your editor, you could also use it as a command line tool. we should look into how best to integrate with atom.
Awesome, good to know! Thanks for the speedy and concise reply.
I’m currently doing linting through the command line and just this morning decided to move it all into atom after installing awatson’s awesome pkg and reading through her notes. As if using stylus already doesn’t make me lazy enough…now I barely have to type anything!
I wrote up how to set up linting with eslint for Sublime, Atom, and Webstorm a couple of months ago. That info should still be valid, though you should keep an eye out for the forthcoming standard .eslintrc file that Sashko mentioned. As others have said, one of the great virtues of eslint is that it is so configurable. You can literally turn off any rule. You can also easily adopt a standard .eslintrc file and just override rules for things like semicolons or single vs. double quotes.
I personally prefer to always use them, but working on the same repository as someone who tries to never use them is where the problem occurs. That’s why I think I’ll just stop using them and override the syntax alert, best solution I guess?
I really like xo https://github.com/sindresorhus/xo#rules, which is built on eslint. But I also really like AVA, the concurrent test framework put out by the same guy. I have a script that calls xo src/**/*.js --plugin=react --esnext --space --fix and it fixes stupid things like missing semicolons automatically & lists out all trickier errors.
Based on Robert and Sashko’s excellent write ups a few months ago, I’ve been testing using .eslintrc in Atom using the linter-eslint package, and it’s been going swimmingly.
In fact, it’s quickly become obvious it’s basically the best linter around. So use that. If you’re not on es2015 yet, I’d also highly recommend the jsformat tool, and you can get both linting and autoformatting for the existing Meteor Style Guide (one of the reasons we’ll be waiting on upgrading to es2015 for a bit yet; since there’s not a good formatting tool yet).
Regardless, both of these packages should be listed in the Atom package readme. Suffice it to say that the Atom Package Manager is sorta wonky and brittle, and my Atom account has been broken for a few months, and I’m waiting for a DB admin at Github to reset the account so I can publish again. I should follow up with them and try to get an Atom release published this week…
@hwillson, I tried to install by you (global), but don’t work with global path.
And then I tried to install atom-fix-path, still don’t work.
(npm get prefix: /usr/local in ubuntu)
Hi newbie here. I am following the guide to install eslint with airbnb style.
When I do $npm install --save-dev eslint eslint-plugin-react eslint-plugin-meteor eslint-config-airbnb
I got the following error:
npm WARN peerDependencies The peer dependency eslint-plugin-react@^4.3.0 included from eslint-config-airbnb will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm ERR! Darwin 15.3.0
npm ERR! argv “node” “/usr/local/bin/npm” “install” “–save-dev” “eslint” “eslint-plugin-react” “eslint-plugin-meteor” "eslint-config-airbnb"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package eslint-plugin-react does not satisfy its siblings’ peerDependencies requirements!
npm ERR! peerinvalid Peer eslint-config-airbnb@7.0.0 wants eslint-plugin-react@^4.3.0