eslint-config-vast-react
ESLint shareable config for React and react-a11y to be used with eslint-config-vast
Installation
npm install --save-dev eslint-config-vast-react eslint-plugin-react eslint-plugin-jsx-a11y
Usage
Create .eslintrc
file in the root of your project with the following config:
{
"extends": ["eslint-config-vast", "eslint-config-vast-react"],
}
You'll probably need to add another config file in the root folder of the client-side code (e.g. app/client/.eslintrc
):
{
"env": {
"browser": true
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 8
},
"globals": {
"SOME_GLOBAL": false
},
"rules": {
}
}
Note: You don't need to use babel-eslint ("parser": "babel-eslint"
) if you are using ES2015 (ES6), ES2016 (ES7) or ES2017 (ES8).
ESLint actually supports ES2015/ES2016/ES2017, JSX, and object rest/spread by default now.
At the moment, you'll need it if you use stuff like class properties, decorators, async/await, types.
Setting up ESLint
To set up ESLint on your project, run:
npm install eslint --save-dev
Add "eslint" to "scripts" in package.json
:
"scripts": {
"eslint": "eslint app tests '*.js' --ext .js --ext .jsx"
}
...and then you can run:
npm run eslint
Related
License
MIT © 2016 Vast.com, Inc.