This is what I did to make it work with vim, meteor and lint.
Get all the npm packages, in my case I need to use the same packages for vim, so I installed them globally.
sudo npm install -g --save-dev eslint-config-airbnb eslint-plugin-import eslint-plugin-meteor eslint-plugin-react eslint-plugin-jsx-a11y eslint
Edit the packages.json with the lint shortcut.
{
....
"scripts": {
"start": "meteor run",
"lint": "eslint .",
"pretest": "npm run lint --silent"
},
...
}
Create the .eslintrc with this settings.
{
"plugins": [
"meteor"
],
"extends": [
"airbnb",
"plugin:meteor/recommended"
],
"rules": {
"meteor/eventmap-params": [
2, { "templateInstanceParamName": "instance" }
],
"import/no-unresolved": [
2, { "ignore": ["^meteor/"] }
],
// enable this._variable (used many times to refer the this._id)
"no-underscore-dangle": ["error", { "allowAfterThis": true }],
// my indentation is four spaces (sorry, its better for me)
"indent": ["error", 4],
// meteor uses globals and includes a lot
"no-unused-vars": 0,
// enable console
"no-console": 0,
},
"env": {
"meteor": true,
"node": true,
"browser": true
},
// ignore some undeclared global variables and methods
// used by Meteor
"globals": {
"describe": false,
"it": false,
"before": false,
"beforeEach": false,
"after": false,
"afterEach": false
}
}
Install the scrooloose/syntastic Vundle in Vim.
" Lint
Plugin 'scrooloose/syntastic'
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_check_on_open=1
Now meteor and vim are using the same .eslinrc configuration file. I can lint with Meteor and also get the lint error report from vim.