... | ... | @@ -6,9 +6,21 @@ Code settings |
|
|
===========
|
|
|
In this project we use a [](https://github.com/standard/standard)
|
|
|
|
|
|
Install **standard** globally:
|
|
|
Install **standard** as a dev dependency.
|
|
|
Optionally (if you use Vue - install `eslint-plugin-vue`
|
|
|
```
|
|
|
npm i -g standard
|
|
|
npm i --save-dev standard eslint-plugin-vue
|
|
|
```
|
|
|
|
|
|
Create `.eslintrc` file in the root of your project and paste there
|
|
|
|
|
|
```
|
|
|
{
|
|
|
"extends": [
|
|
|
"plugin:vue/recommended",
|
|
|
"standard"
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
|
|
|
In the WebStorm IDE:
|
... | ... | @@ -22,9 +34,7 @@ File->Settings->Languages and Frameworks->Node.js and NPM |
|
|
|
|
|
File->Settings->Languages and Frameworks->JavaScript -> Code Quality Tools -> ESLint
|
|
|
- Click `Enable`
|
|
|
- For **WebStorm >= 2017.3** in the combo `ESLint package` select `~\AppData\Roaming\npm\node_modules\standard`
|
|
|
- For **WebStorm 2017.1** - go to Editor->Code Style->JavaScript and select `Standard` schema
|
|
|
- For **WebStorm < 2017.1** - see [manual configuration instruction](https://github.com/feross/standard/blob/master/docs/webstorm.md)
|
|
|
- select path to `nodejs` (in my case `/usr/bin/node`) & path to eslint (in my case `~/dev/ubjs/node_modules/eslint`)
|
|
|
|
|
|
Editor->File Types
|
|
|
- Select `Recognized File Types` JavaScript
|
... | ... | |