Skip to content

Commit

Permalink
feat(eslint-plugin): remove exported parser (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Jan 20, 2019
1 parent 7d178a9 commit 0ddb93c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 30 deletions.
27 changes: 7 additions & 20 deletions packages/eslint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,40 @@

## Installation

You'll first need to install [ESLint](http://eslint.org):

```sh
npm i eslint --save-dev
```

Next, install `typescript` if you haven’t already:

```sh
npm i typescript@~3.1.1 --save-dev
```

Last, install `@typescript-eslint/eslint-plugin`:
Make sure you have TypeScript and @typescript-eslint/parser installed, then install the plugin:

```sh
npm i @typescript-eslint/eslint-plugin --save-dev
```

It is important that you use the same version number for `@typescript-eslint/parser` and `@typescript-eslint/eslint-plugin`.

**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `@typescript-eslint/eslint-plugin` globally.

## Usage

Add `@typescript-eslint/eslint-plugin/parser` to the `parser` field and `typescript` to the plugins section of your `.eslintrc` configuration file:
Add `@typescript-eslint/parser` to the `parser` field and `@typescript-eslint` to the plugins section of your `.eslintrc` configuration file:

```json
{
"parser": "@typescript-eslint/eslint-plugin/parser",
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"]
}
```

Note: The plugin provides its own version of the `@typescript-eslint/parser` via `@typescript-eslint/eslint-plugin/parser`.
This helps us guarantee 100% compatibility between the plugin and the parser.

Then configure the rules you want to use under the rules section.

```json
{
"parser": "@typescript-eslint/eslint-plugin/parser",
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/rule-name": "error"
}
}
```

You can also enable all the recommended rules at once. Add `plugin:typescript/recommended` in extends:
You can also enable all the recommended rules at once. Add `plugin:@typescript-eslint/recommended` in extends:

```json
{
Expand Down
10 changes: 0 additions & 10 deletions packages/eslint-plugin/parser.js

This file was deleted.

0 comments on commit 0ddb93c

Please sign in to comment.