Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#update_readme_20170828 #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,43 @@ Install eslint npm package [eslint npm](https://www.npmjs.org/package/eslint)</a
$ cd <project path>
$ npm install eslint
```
Or, install eslint globally:<br/>
<b>(Recommend!)</b>
Or, install eslint globally, REMEMBER the eslint plugins followed:<br/>
```bash
$ npm install -g eslint
$ sudo npm install -g eslint
$ sudo npm install -g eslint-config-standard
$ sudo npm install -g eslint-plugin-import
$ sudo npm install -g eslint-plugin-node
$ sudo npm install -g eslint-plugin-promise
$ sudo npm install -g eslint-plugin-standard
```

### Using in CLI ###
To get started with CLI, you need to get familiar with the following cmd:<br/>

* Lint folder/project
```bash
$ eslint ./controllers/.
```
Output:<br/>
__/path/to/dcos_ops/web/controllers/war/action/create.js__<br/>
__1:7 error 'config' is assigned a value but never used no-unused-vars__<br/>
_Note: you could fix your codes upon the 'error'_

* Lint single target js file
```bash
$ eslint ./controllers/war/action/create.js
```
Output:<br/>
_Note: after you have fix the 'error', the output will be nothing_

### Settings ###
To get started, you need to set the ESLint plugin settings:<br/>
To get started with Idea, you need to set the ESLint plugin settings:<br/>

* Go to preferences, ESLint plugin page and check the Enable plugin.
* Set the path to the nodejs interpreter bin file.
* Select whether to let eslint search for ```.eslintrc``` file
* Set the path to the eslint bin file. should point to ```<project path>node_modules/eslint/bin/eslint.js``` if you installed locally or ```/usr/local/bin/eslint``` if you installed globally.
* Set the path to the eslint bin file. should point to ```<project path>node_modules/eslint/bin/eslint.js``` if you installed locally or ```/usr/local/bin/eslint``` if you installed globally.
* For Windows: install eslint globally and point to the eslint cmd file like, e.g. ```C:\Users\<username>\AppData\Roaming\npm\eslint.cmd```
* Set the ```.eslintrc``` file, or eslint will use the default settings.
* You can also set a path to a custom rules directory.
Expand Down