Skip to content

feat(eslint-plugin): remove exported parser #94

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

Merged
merged 1 commit into from
Jan 20, 2019
Merged
Show file tree
Hide file tree
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
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.