Linting for Meteor

Does anyone have a suggestion for going about linting without having to write an eslint config from scratch? Something I can take and use with meteor with minimal hassle? If you point me at a config it needs to have support for jsx/es2015.

.eslintrc from Mantra :wink: https://github.com/mantrajs/mantra-sample-blog-app/blob/master/.eslintrc

1 Like

How do you actually get eslint running in Meteor?

I tried npm install --save-dev eslint-plugin-react eslint and added a copy of the Mantra .eslintrc file to the root of my project, but I’m not getting any linting messages when I run my Meteor app (and I definitely should be!)

You can lint your app with npm run lint for Mantra. Or just use background linting with your preffered IDE or text editor like sublime or vim or atom

3 Likes

Ah of course, I hadn’t thought of running it from the IDE.

I’m using WebStorm, here are the links for getting it going for anyone else who is interested:
https://www.jetbrains.com/webstorm/help/eslint.html
https://www.jetbrains.com/webstorm/help/using-javascript-code-quality-tools.html

You then get eslint colour coding in the side scrollbar.

MDG is going to be recommending an eslint config based on Airbnb’s style guide. You can find Airbnb’s eslint config here.

If you’re interested in setting this up with Atom, I posted about it here.

(EDIT: Just to add, you can also take a look at the eslintrc MDG is using in the Guide’s sample app.)

2 Likes