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

chore: add typescript as optionalDependency #1046

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ We will always endeavor to support the latest stable version of TypeScript. Some

**The version range of TypeScript currently supported by this parser is `>=3.2.1 <3.7.0`.**

This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.
This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `optionalDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe would be good to add a comment stating explicitly that we expect the user to install typescript in the project root?

might as well be explicit.


If you use a non-supported version of TypeScript, the parser will log a warning to the console. If you want to disable this warning, you can configure this in your `parserOptions`. See: [`@typescript-eslint/parser`](./packages/parser/) and [`@typescript-eslint/typescript-estree`](./packages/typescript-estree/).

Expand Down
2 changes: 2 additions & 0 deletions packages/parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
npm install @typescript-eslint/parser --save-dev
```

Note: `@typescript-eslint/parser` assumes you have `typescript` already installed. Please read the documentation [here](https://github.com/typescript-eslint/typescript-eslint#supported-typescript-version) for more details.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably want this in eslint-plugin as well, as eslint-plugin also directly consumes typescript.


## Usage

In your ESLint configuration file, set the `parser` property:
Expand Down
2 changes: 2 additions & 0 deletions packages/typescript-estree/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ In fact, it is already used within these hyper-popular open-source projects to p
npm install @typescript-eslint/typescript-estree --save-dev
```

Note: `@typescript-eslint/typescript-estree` assumes you have `typescript` already installed. Please read the documentation [here](https://github.com/typescript-eslint/typescript-eslint#supported-typescript-version) for more details.

## API

### parse(code, options)
Expand Down
3 changes: 3 additions & 0 deletions packages/typescript-estree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,8 @@
"glob": "^7.1.4",
"lodash.isplainobject": "4.0.6",
"typescript": "*"
},
"optionalDependencies": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto for needing this in eslint-plugin - might as well be consistent :)
parser consumes typescript-estree so it isn't needed there.

"typescript": "*"
}
}