Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit 75f1020

Browse files
committed
Merge remote-tracking branch 'upstream/master' into add-visitor-keys
2 parents cd810f3 + bedcd10 commit 75f1020

19 files changed

+43
-4680
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
v19.0.1 - September 25, 2018
2+
3+
* 7a367c7 Fix: Remove lib from package.json files (#518) (James Henry)
4+
5+
v19.0.0 - September 25, 2018
6+
7+
* 3d3ab2f Breaking: Use typescript-estree for parsing (#515) (James Henry)
8+
19
v18.0.0 - August 6, 2018
210

311
* 16d1a78 Breaking: Support TypeScript 3.0 (#504) (James Henry)

Makefile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const NODE_MODULES = "./node_modules/",
3838
// Files
3939
MAKEFILE = "./Makefile.js",
4040
/* eslint-disable no-use-before-define */
41-
JS_FILES = `${find("lib/").filter(fileType("js")).join(" ")} parser.js`,
41+
JS_FILES = "parser.js visitor-keys.js",
4242
TEST_FILES = find("tests/lib/").filter(fileType("js")).join(" "),
4343
TOOLS_FILES = find("tools/").filter(fileType("js")).join(" ");
4444
/* eslint-enable no-use-before-define */

README.md

+13-25
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
# TypeScript ESLint Parser
22

3-
A parser that converts TypeScript source code into an [ESTree](https://github.com/estree/estree)-compatible form.
3+
An ESLint custom parser which leverages [TypeScript ESTree](https://github.com/JamesHenry/typescript-estree) to allow for ESLint to lint TypeScript source code.
44

5-
## Usage
65

7-
This parser is actually somewhat generic and robust - it could be used to power any use-case which requires taking TypeScript source code and producing an ESTree-compatiable AST.
6+
## Installation:
87

9-
In fact, that is exactly what it is used for in the popular open-source code formatter, [Prettier](https://prettier.io), to power its TypeScript support.
8+
```sh
9+
npm install --save-dev typescript-eslint-parser
10+
```
1011

11-
Nevertheless, the parser does have a special appreciation for ESLint-specific use-cases built in, and can even produce a slightly different AST for ESLint if needed (using the special `parseForESLint()` method).
12+
## Usage
1213

13-
The majority of users of this parser use it to enable them to use ESLint on their TypeScript source files, so they will not actually be interacting with the parser directly. Instead they will configure ESLint to use it instead of its default parser, [espree](https://github.com/eslint/espree), which does not understand TypeScript.
14+
In your ESLint configuration file, set the `parser` property:
1415

15-
## Usage with ESLint
16+
```json
17+
"parser": "typescript-eslint-parser"
18+
```
1619

1720
There is sometimes an incorrect assumption that the parser itself is what does everything necessary to facilitate the use of ESLint with TypeScript. In actuality, it is the combination of the parser _and_ one or more plugins which allow you to maximize your usage of ESLint with TypeScript.
1821

@@ -24,18 +27,6 @@ Instead, you also need to make use of one more plugins which will add or extend
2427

2528
By far the most common case will be installing the [eslint-plugin-typescript](https://github.com/nzakas/eslint-plugin-typescript) plugin, but there are also other relevant options available such a [eslint-plugin-tslint](https://github.com/JamesHenry/eslint-plugin-tslint).
2629

27-
Install:
28-
29-
```sh
30-
npm install --save-dev typescript-eslint-parser
31-
```
32-
33-
And in your ESLint configuration file:
34-
35-
```json
36-
"parser": "typescript-eslint-parser"
37-
```
38-
3930
## Supported TypeScript Version
4031

4132
We will always endeavor to support the latest stable version of TypeScript.
@@ -52,9 +43,7 @@ If you're familiar with TypeScript and ESLint, and you'd like to see this projec
5243

5344
## Reporting Issues
5445

55-
The vast majority of issues which are submitted here are not actually parsing bugs at all. They are integration issues with the ESLint ecosystem.
56-
57-
This is not ideal, but users need a place to be able to report those things, so it has become accepted that that will also be done in this repo.
46+
Please **do not report parsing/AST issues in this repo**, report them directly to [TypeScript ESTree](https://github.com/JamesHenry/typescript-estree).
5847

5948
Please check the current list of open and known issues and ensure the issue has not been reported before. When creating a new issue provide as much information about your environment as possible. This includes:
6049

@@ -69,9 +58,9 @@ We have a very flexible way of running integration tests which connects all of t
6958

7059
We run each test within its own docker container, and so each one has complete autonomy over what dependencies/plugins are installed and what versions are used. This also has the benefit of not bloating the `package.json` and `node_modules` of the parser project itself.
7160

72-
> If you are going to submit an issue related to the usage of this parser with ESLint, please consider creating a failing integration which clearly demonstrates the behavior. It's honestly super quick!
61+
> If you are going to submit an issue related to the usage of this parser with ESLint, please consider creating a failing integration test which clearly demonstrates the behavior. It's honestly super quick!
7362
74-
You just need to duplicate on of the existing test sub-directories found in `tests/integration/`, tweak the dependencies and ESLint config to match what you need, and add a new entry to the docker-compose.yml file which matches the format of the existing ones.
63+
You just need to duplicate one of the existing test sub-directories found in `tests/integration/`, tweak the dependencies and ESLint config to match what you need, and add a new entry to the docker-compose.yml file which matches the format of the existing ones.
7564

7665
Then run:
7766

@@ -93,7 +82,6 @@ Issues and pull requests will be triaged and responded to as quickly as possible
9382

9483
- `npm test` - run all linting and tests
9584
- `npm run lint` - run all linting
96-
- `npm run ast-alignment-tests` - run only Babylon AST alignment tests
9785
- `npm run integration-tests` - run only integration tests
9886

9987
## License

lib/ast-converter.js

-76
This file was deleted.

lib/ast-node-types.js

-162
This file was deleted.

0 commit comments

Comments
 (0)