You may place .eslintrc in your project directory and/or your home directory ~/.eslintrc.
Install the linters globally via npm:
$ bash install.shUpdate your .vimrc if you are using syntastic.
Documentation on configuring ESLint.
| { | |
| "parser": "babel-eslint", | |
| "env": { | |
| "browser": true, // allow browser globals like `window` and `document` | |
| "node": true, // allow node globals like `process` | |
| "commonjs": true, // allow globals like `require` and `exports` | |
| "mocha": true // allow mocha globals like `describe` and `it` | |
| }, | |
| "settings": { | |
| "ecmascript": 6, | |
| "jsx": true // react jsx syntax | |
| }, | |
| "plugins": [ | |
| "react" | |
| ], | |
| "extends": "eslint:recommended", // use recommended settings from eslint | |
| "rules": { | |
| // 0 = "off" | |
| // 1 = "warn" | |
| // 2 = "error" | |
| "strict": 2, // always enable strict mode | |
| "semi": 2, // semicolons | |
| "index": [ | |
| "error", | |
| 4 // use 4 spaces | |
| ], | |
| "quotes": [ | |
| "error", | |
| "single" // use single quotes | |
| ], | |
| "no-unused-vars": 2, // no unused variables | |
| "linebreak-style": 2, // default is unix | |
| "eol-last": 2, // default is unix | |
| "no-mixed-requires": 0, | |
| "no-underscore-dangle": 0, | |
| "camelcase": 0, | |
| "react/jsx-uses-vars": 1 | |
| } | |
| } |
| let g:syntastic_javascript_checkers = ['eslint'] |
You may place .eslintrc in your project directory and/or your home directory ~/.eslintrc.
Install the linters globally via npm:
$ bash install.shUpdate your .vimrc if you are using syntastic.
Documentation on configuring ESLint.
| #!/usr/bin/env bash | |
| npm install -g eslint | |
| npm install -g babel-eslint | |
| npm install -g eslint-plugin-react |