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

Breaking: typescript-estree v5 #538

Merged
merged 5 commits into from
Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from 3 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
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ By far the most common case will be installing the [eslint-plugin-typescript](ht

## Options

The full list of options can be found in the [typescript-estree README](https://github.com/JamesHenry/typescript-estree#parsecode-options). Use them like this in your eslintrc:
**`jsx`** - default `false`. Enable parsing JSX when `true`. More details can be found [here](https://www.typescriptlang.org/docs/handbook/jsx.html).
Copy link
Member Author

Choose a reason for hiding this comment

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

There are technically other options (range, loc, comment, etc.), but these aren't particularly useful for the end user, since ESLint supplies them. I think we should document the API (parse(), parseForESLint(), etc.) and document those options there.


```js
parserOptions: {
ecmaFeatures: {
jsx: true,
}
**`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`.

```json
{
"parserOptions": {
"jsx": true,
"useJSXTextNode": true
}
}
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"dependencies": {
"eslint": "4.19.1",
"eslint-visitor-keys": "^1.0.0",
"typescript-estree": "2.1.0"
"typescript-estree": "5.0.0"
},
"peerDependencies": {
"typescript": "*"
Expand Down
9 changes: 9 additions & 0 deletions tests/lib/__snapshots__/basics.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Object {
"type": "ExpressionStatement",
},
],
"comments": Array [],
"loc": Object {
"end": Object {
"column": 0,
Expand Down Expand Up @@ -499,6 +500,7 @@ Object {
"type": "DoWhileStatement",
},
],
"comments": Array [],
"loc": Object {
"end": Object {
"column": 0,
Expand Down Expand Up @@ -1177,6 +1179,7 @@ Object {
"type": "FunctionDeclaration",
},
],
"comments": Array [],
"loc": Object {
"end": Object {
"column": 0,
Expand Down Expand Up @@ -1544,6 +1547,7 @@ Object {
"type": "ExpressionStatement",
},
],
"comments": Array [],
"loc": Object {
"end": Object {
"column": 17,
Expand Down Expand Up @@ -1712,6 +1716,7 @@ Object {
"type": "ExpressionStatement",
},
],
"comments": Array [],
"loc": Object {
"end": Object {
"column": 0,
Expand Down Expand Up @@ -1973,6 +1978,7 @@ Object {
"type": "ExpressionStatement",
},
],
"comments": Array [],
"loc": Object {
"end": Object {
"column": 6,
Expand Down Expand Up @@ -2215,6 +2221,7 @@ Object {
"type": "ExpressionStatement",
},
],
"comments": Array [],
"loc": Object {
"end": Object {
"column": 0,
Expand Down Expand Up @@ -2515,6 +2522,7 @@ Object {
"type": "ExpressionStatement",
},
],
"comments": Array [],
"loc": Object {
"end": Object {
"column": 4,
Expand Down Expand Up @@ -2974,6 +2982,7 @@ Object {
"type": "ExpressionStatement",
},
],
"comments": Array [],
"loc": Object {
"end": Object {
"column": 0,
Expand Down
Loading