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

Commit 14e2499

Browse files
committed
Merge remote-tracking branch 'origin/master' into fix-scope-analysis
# Conflicts: # package.json
2 parents 95a8380 + a9d932a commit 14e2499

14 files changed

+715
-72
lines changed

README.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ npm install --save-dev typescript-eslint-parser
1717
In your ESLint configuration file, set the `parser` property:
1818

1919
```json
20-
"parser": "typescript-eslint-parser"
20+
{
21+
"parser": "typescript-eslint-parser"
22+
}
2123
```
2224

2325
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.
@@ -30,6 +32,26 @@ Instead, you also need to make use of one more plugins which will add or extend
3032

3133
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).
3234

35+
## Configuration
36+
37+
The following additional configuration options are available by specifying them in [`parserOptions`](https://eslint.org/docs/user-guide/configuring#specifying-parser-options) in your ESLint configuration file.
38+
39+
**`jsx`** - default `false`. Enable parsing JSX when `true`. More details can be found [here](https://www.typescriptlang.org/docs/handbook/jsx.html).
40+
41+
**`useJSXTextNode`** - default `false`. The JSX AST changed the node type for string literals inside a JSX Element from `Literal` to `JSXText`. When value is `true`, these nodes will be parsed as type `JSXText`. When value is `false`, these nodes will be parsed as type `Literal`.
42+
43+
### .eslintrc.json
44+
45+
```json
46+
{
47+
"parser": "typescript-eslint-parser",
48+
"parserOptions": {
49+
"jsx": true,
50+
"useJSXTextNode": true
51+
}
52+
}
53+
```
54+
3355
## Supported TypeScript Version
3456

3557
We will always endeavor to support the latest stable version of TypeScript.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"eslint-scope": "^4.0.0",
5555
"eslint-visitor-keys": "^1.0.0",
5656
"lodash": "^4.17.11",
57-
"typescript-estree": "2.1.0"
57+
"typescript-estree": "5.0.0"
5858
},
5959
"peerDependencies": {
6060
"typescript": "*"

tests/lib/__snapshots__/basics.js.snap

+9
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Object {
9494
"type": "ExpressionStatement",
9595
},
9696
],
97+
"comments": Array [],
9798
"loc": Object {
9899
"end": Object {
99100
"column": 0,
@@ -499,6 +500,7 @@ Object {
499500
"type": "DoWhileStatement",
500501
},
501502
],
503+
"comments": Array [],
502504
"loc": Object {
503505
"end": Object {
504506
"column": 0,
@@ -1177,6 +1179,7 @@ Object {
11771179
"type": "FunctionDeclaration",
11781180
},
11791181
],
1182+
"comments": Array [],
11801183
"loc": Object {
11811184
"end": Object {
11821185
"column": 0,
@@ -1544,6 +1547,7 @@ Object {
15441547
"type": "ExpressionStatement",
15451548
},
15461549
],
1550+
"comments": Array [],
15471551
"loc": Object {
15481552
"end": Object {
15491553
"column": 17,
@@ -1712,6 +1716,7 @@ Object {
17121716
"type": "ExpressionStatement",
17131717
},
17141718
],
1719+
"comments": Array [],
17151720
"loc": Object {
17161721
"end": Object {
17171722
"column": 0,
@@ -1973,6 +1978,7 @@ Object {
19731978
"type": "ExpressionStatement",
19741979
},
19751980
],
1981+
"comments": Array [],
19761982
"loc": Object {
19771983
"end": Object {
19781984
"column": 6,
@@ -2215,6 +2221,7 @@ Object {
22152221
"type": "ExpressionStatement",
22162222
},
22172223
],
2224+
"comments": Array [],
22182225
"loc": Object {
22192226
"end": Object {
22202227
"column": 0,
@@ -2515,6 +2522,7 @@ Object {
25152522
"type": "ExpressionStatement",
25162523
},
25172524
],
2525+
"comments": Array [],
25182526
"loc": Object {
25192527
"end": Object {
25202528
"column": 4,
@@ -2974,6 +2982,7 @@ Object {
29742982
"type": "ExpressionStatement",
29752983
},
29762984
],
2985+
"comments": Array [],
29772986
"loc": Object {
29782987
"end": Object {
29792988
"column": 0,

0 commit comments

Comments
 (0)