Skip to content

Commit

Permalink
Docs: Update installation instructions on README (#6569)
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Jul 1, 2016
1 parent dc5b78b commit 66de9d8
Showing 1 changed file with 40 additions and 8 deletions.
48 changes: 40 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,53 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J
* ESLint uses an AST to evaluate patterns in code.
* ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime.

## Installation
## Installation and Usage

You can install ESLint using npm:
There are two ways to install ESLint: globally and locally.

npm install -g eslint
### Local Installation and Usage

## Usage
If you want to include ESLint as part of your project's build system, we recommend installing it locally. You can do so using npm:

If it's your first time using ESLint, you should set up a config file using `--init`:
```
$ npm install eslint --save-dev
```

You should then setup a configuration file:

```
$ ./node_modules/.bin/eslint --init
```

After that, you can run ESLint on any file or directory like this:

```
$ ./node_modules/.bin/eslint yourfile.js
```

Any plugins or shareable configs that you use must also be installed locally to work with a locally-installed ESLint.

eslint --init
### Global Installation and Usage

After that, you can run ESLint on any JavaScript file:
If you want to make ESLint available to tools that run across all of your projects, we recommend installing ESLint globally. You can do so using npm:

```
$ npm install -g eslint
```

You should then setup a configuration file:

```
$ eslint --init
```

After that, you can run ESLint on any file or directory like this:

```
$ eslint yourfile.js
```

eslint test.js test2.js
Any plugins or shareable configs that you use must also be installed globally to work with a globally-installed ESLint.

**Note:** `eslint --init` is intended for setting up and configuring ESLint on a per-project basis and will perform a local installation of ESLint and its plugins in the directory in which it is run. If you prefer using a global installation of ESLint, any plugins used in your configuration must also be installed globally.

Expand Down

0 comments on commit 66de9d8

Please sign in to comment.