-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Import typescript-eslint-parser and history #6
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
Changes from all commits
Commits
Show all changes
326 commits
Select commit
Hold shift + click to select a range
5f04bb5
Fix: Exception thrown when space occurs after function name (fixes #1…
soda0289 39de41b
Fix: Handle async/await (fixes #119) (#129)
flying-sheep 5e0999e
Fix: Add missing async property (#133)
JamesHenry 43ddc1a
Build: package.json and changelog update for 1.0.1
2316bf3
1.0.1
98e4365
Fix: export type alias ExportNamedDeclaration node generation (fixes …
weirdpattern e46f570
Fix: Use ts utilities determine variable declaration type (fixes #136…
soda0289 1e64712
Build: package.json and changelog update for 1.0.2
b36d2f6
1.0.2
bf07366
Fix: Calculate constructor range using node.parameters.pos (fixes #13…
soda0289 7307e03
Fix: Calculate range correctly when class is exported (fixes #152) (#…
soda0289 4063788
Fix: Parameter with assignation provide type annotations (fixes #146)…
weirdpattern 8915626
Fix: Handle object types without annotations (fixes #148) (#154)
soda0289 aa8c499
Fix: Calculate range correctly for exported generic class (fixes #152…
soda0289 68393bc
Docs: Show currently supported TypeScript version (#157)
JamesHenry 3799d16
Build: package.json and changelog update for 1.0.3
58bbd02
1.0.3
4b60c7f
Fix: Unescape identifiers typescript may prepend underscore (fixes #1…
soda0289 d9aa28d
Fix: Await node should have argument property (fixes #160) (#161)
soda0289 5b87d97
Fix: Optimize convertTokens, treat JsxText as token (fixes #70) (#158)
JamesHenry 5e9ba53
Breaking: Updated supported TypeScript version to ~2.2.1 (fixes #149)…
JamesHenry b87cd4c
Build: package.json and changelog update for 2.0.0
401f8f0
2.0.0
3520a3b
Fix: Convert Void and Delete expressions to UnaryExpression (fixes #1…
soda0289 29fdc1a
Fix: Set name to type JSXIdentifier and fix selfClosing (fixes #172) …
soda0289 f3dd68c
Fix: Remove jsdoc node property from ts nodes (fixes #164) (#177)
soda0289 275895c
Fix: Add start and end property to tokens (fixes #172) (#176)
soda0289 318d4f5
Chore: Add test for constructor and methods with parameters (refs #16…
soda0289 8112604
Fix: Missing parameter properties info in constructors (fixes #143) (…
weirdpattern 0e4a524
Fix: Change DoWhileStatement to DoStatement to match TS (fixes #180) …
JamesHenry 76d0f03
Fix: Add missing typeAnnotation to class properties (fixes #190) (#191)
Pajn 8b43628
New: Mark optional parameters and properties (fixes #186) (#187)
Pajn 4b56d43
Fix: Updated broken class-with-optional-properties test result (#192)
JamesHenry bd4ba37
New: Store type parameter constraints (fixes #188) (#189)
Pajn f823e08
Fix: Convert MetaProperty (new.target) nodes correcly (fixes #194) (#…
soda0289 3609d46
New: Add type parameters to more AST nodes (fixes #184) (#183)
Pajn 003caf0
Fix: Preserve type parameters for methods (fixes #202) (#203)
Pajn ea02808
Fix: Nested type arguments are not preserved (fixes #204) (#205)
Pajn 6b1e90a
Fix: Optional methods are not marked as optional (fixes #206) (#207)
Pajn 5ca975f
Fix: Set root to true in eslintrc (fixes #211) (#212)
soda0289 370a217
Build: changelog update for 2.1.0
a4651a1
2.1.0
9412d29
Fix: Wrap any parameter with modifiers, not just in constructors (#214)
Pajn af8fec4
Update: Open TS peerDependency, warn non-supported version (fixes #16…
JamesHenry 416d21b
Chore: Cleanup Makefile (#221)
soda0289 e2bb55c
Chore: Remove before_script from .travis.yml (fixes #231) (#230)
JamesHenry 9bad73f
Breaking: Add .body to TSModuleBlock nodes (fixes #217) (#218)
flying-sheep c01e40e
Fix: Use TSAbsractMethodDefinition for abstract constructor (fixes #2…
azz d12d4b4
Breaking: Support TypeScript 2.3 (fixes #232) (#233)
azz d4d5488
Fix: Support superTypeParameters (fixes #242) (#243)
azz 784bf30
New: Add support for default type parameters (fixes #235) (#240)
soda0289 f48ab16
Fix: Label abstract class properties (fixes #234) (#238)
soda0289 ff48efc
Chore: Add tests for object spread and async generator (refs #236) (#…
soda0289 97fe4a6
Fix: Set async on async FunctionExpressions (fixes #244) (#245)
azz 035d0ee
Fix: Set await property on async iterators (for await) (fixes #236) (…
soda0289 16eb44a
Breaking: Change how interface node gets converted (fixes #201) (#241)
soda0289 73d24cf
Upgrade: Update semver package (#246)
SimenB c92d356
Fix: add `instanceof` to ast-converter (fixes #252) (#251)
despairblue e0360f1
Fix: Handle case where class has extends but no super class (fixes #2…
soda0289 06cb0af
Fix: Type parameter start location calculation (fixes #260) (#259)
Igorbek 6eb80c5
Breaking: Normalize type parameters (fixes #197) (#196)
Pajn e2c98af
Chore: Update README with list of known issues (#247)
soda0289 c0a84cb
Chore: Refactor the codebase (fixes #220) (#261)
JamesHenry bb4e173
Breaking: Allow comment scanner to rescan tokens (fixes #216) (#219)
soda0289 a605fbe
Fix: Use correct starting range and loc for JSXText tokens (fixes #22…
soda0289 a9ad056
Build: changelog update for 3.0.0
31533ca
3.0.0
5b166d0
Fix: wrap interface in ExportNamedDeclaration if necessary (fixes #26…
despairblue e084f9b
Fix: Convert range and line number corretly in JSX literals (#277)
soda0289 e431bb1
Fix: Replace JSXMemberExpression with TSQualifiedName (fixes #257) (#…
azz 54a42f4
Fix: Add exponentiation operators (fixes #280) (#281)
azz 031433d
New: Create option to enable JSXText node type (fixes #266) (#272)
soda0289 a589226
Fix: Convert type guards (fixes #282) (#283)
JamesHenry ce8a48b
Fix: Set node type to ExperimentalRestProperty (fixes #276) (#279)
soda0289 6f4ced9
Fix: Create RegExp object for RegExp literals (fixes #287) (#291)
soda0289 ba2af10
Fix: Async generator method should be labeled (fixes #297) (#299)
soda0289 30a2c05
Fix: Unescape type parameter names (fixes #296) (#298)
soda0289 bceb7c8
Fix: Label static and export in TSParameterProperty (fixes #286) (#301)
soda0289 17c1391
Fix: Only set optional property on certain node property (fixes #289)…
soda0289 02a01fe
Breaking: Convert Signature types to be more ESTree like (fixes #262)…
soda0289 c3326d5
Breaking: Decorator ESTree compliance, always convert (fixes #250) (#…
JamesHenry 6d7f051
Chore: Replace mocha (istanbul, chai, leche) with Jest (#300)
JamesHenry b33e64a
Breaking: Change isReadonly to readonly (fixes #284) (#285)
JamesHenry 33f8afa
Chore: Fix typo in comment (#305)
jtheoof 901122b
Fix: Add more tests for destructuring and spread (fixes #306) (#308)
soda0289 ce2688c
Fix: Label readonly class properties (fixes #302) (#303)
soda0289 b6e56c9
Breaking: Use ESTree export node types in modules (fixes# 263) (#265)
soda0289 f7592e2
Fix: Add name to JSXIdentifier when converting ThisKeyword (fixes #30…
soda0289 e0ef6b4
Chore: Refactor tests to assert snapshots not JSON (#311)
JamesHenry b7bfe58
Chore: Add node 8 to .travis.yml (#312)
JamesHenry 634bb2d
Fix: Use TSNullKeyword for null type instead of Literal (#313)
JamesHenry 2ec09ad
Fix: Use TSExportAssignment node type (fixes #304) (#317)
soda0289 e973e67
Fix: Ensure JSX tag names are JSXIdentifiers (fixes #315) (#318)
soda0289 e109963
Fix: Calculate correct type parameter range (fixes #316) (#320)
soda0289 8069f08
New: Provider loggerFn option to configure logging (fixes #323) (#324)
JamesHenry 926f93c
Breaking: Remove TypeAnnotation wrapper from constraint (#325)
JamesHenry e56d8c8
Fix: Unescape string literal identifiers (fixes #328) (#330)
azz 60385f5
Fix: Arrow function body should be ObjectExpression (fixes #331) (#334)
soda0289 d9772e3
Breaking: Include type annotation range for Identifiers (fixes #314) …
soda0289 4dd0686
Build: changelog update for 4.0.0
d571345
4.0.0
16418b1
Fix: Handle assignment within property destructuring (fixes #332) (#336)
JamesHenry f4c4718
Fix: Use name 'this' in JSXMemberExpression (fixes #337) (#338)
soda0289 aeb8d47
Breaking: Use TSTypeReference for TypeParameters (#340)
JamesHenry 39b7578
New: Support TypeScript 2.4 (fixes #321) (#322) (#326)
JamesHenry a614369
Build: changelog update for 5.0.0
d859cf6
5.0.0
320339c
Chore: AST alignment testing against Babylon (#342)
JamesHenry 4b93259
Fix: Only warn about an unsupported TypeScript version once (#347)
j-f1 8674b8b
Build: changelog update for 5.0.1
cb597c1
5.0.1
7a08ce4
Fix: Remove start and end values from JSX tokens (fixes #341) (#351)
JamesHenry e8da1cb
Fix: Include newlines at the end of source in AST (fixes #352) (#353)
JamesHenry ac299d0
Fix: Exp. operator assignment is AssignmentExpression (fixes #355) (#…
JamesHenry 53396fd
Fix: Location data for methods and constructors (#357)
JamesHenry b11b8fd
Breaking: Only add .implements/.accessibility/.decorators if truthy (…
JamesHenry 681c2e9
Chore: Build out AST comparison tests and categorize issues (#358)
JamesHenry 8e5404f
Chore: Breakout and label TS-specific AST comparison tests (#360)
JamesHenry fc41420
Fix: Allow other orderings of implements/extends clauses (fixes #361)…
j-f1 aebab32
Breaking: Explicitly handle TSEnumDeclaration (fixes #345) (#364)
JamesHenry 946c12e
Build: changelog update for 6.0.0
bad870f
6.0.0
a383971
Fix: Ensure modifiers are applied to enums (fixes #365) (#366)
JamesHenry aadff2a
Build: changelog update for 6.0.1
ba92285
6.0.1
1f1b27a
Fix: Typo in TSExportAssignment node type (#367)
JamesHenry 13607fd
Breaking: Handle TSModuleDeclaration and refactor (fixes #371) (#372)
JamesHenry 89154fd
Breaking: Check for isTypeKeyword in type params (fixes #373) (#374)
JamesHenry 7c5fc48
Fix: Ensure exports applied to TSModuleDeclaration (#375)
JamesHenry 2158fc6
Build: changelog update for 7.0.0
823b215
7.0.0
1432db0
Fix: Location data for typeAnnotations (#378)
JamesHenry ded5e1f
Breaking: Support TypeScript 2.5 (fixes #368) (#369) (#370)
JamesHenry 68aabd1
Build: changelog update for 8.0.0
7d1b618
8.0.0
d81798a
Chore: Minor cleanup, fix jQuery foundation copyright (#383)
JamesHenry 103c207
Chore: Refactor alignment tests, now on by default (#387)
JamesHenry 6a28e31
Fix: add missing TSSymbolKeyword type (#385)
ikatyang a14b666
Chore: Add a way to test TSX specific issues (fixes #376) (#398)
JamesHenry 90deceb
Fix: Calculate typeArguments loc data correctly if empty (fixes #395)…
JamesHenry a02b5d8
Build: changelog update for 8.0.1
7894d68
8.0.1
6ada8fe
Breaking: Support TypeScript 2.6 (fixes #394) (#397)
JamesHenry cc8ae63
Build: changelog update for 9.0.0
5e9d38c
9.0.0
5f3c878
Fix: Explicitly convert AbstractKeyword (fixes #407) (#408)
JamesHenry 8223748
Fix: Calculate end position of TypeInstantiation (fixes #406) (#405)
duailibe fe68684
Build: changelog update for 9.0.1
b125dd9
9.0.1
957a1bc
Chore: No package-lock like other ESLint repos (#409)
JamesHenry 670f6af
Chore: Introduce integration tests (#411)
JamesHenry d2af1a4
Breaking: Updates to AST node types of some TSNodes (fixes #386) (#388)
JamesHenry 21f30bb
Build: changelog update for 10.0.0
0008055
10.0.0
a282e40
Breaking: Implement parseForESLint() function (#412)
JamesHenry 2806a5a
Breaking: No prefix on FnDec within namespace (fixes #127) (#413)
JamesHenry 069e711
Build: changelog update for 11.0.0
d2c659f
11.0.0
8b068c6
Docs: Sets default code block language in issue template to "ts" (#421)
mariusschulz 7d12e00
Breaking: Properly categorize constructors with no body (#427)
j-f1 6a2f843
Build: changelog update for 12.0.0
ffe3ca2
12.0.0
cce15a2
Docs: Update Known Issues section of README (#440)
keplersj 482f931
Breaking: Support TypeScript 2.7 (fixes #442,#426) (#447)
JamesHenry 74695dc
Build: changelog update for 13.0.0
3dedcc5
13.0.0
1f499c7
Breaking: Remove all tokens inside comments from tokens array (fixes …
kaicataldo 28ab9aa
New: Support Definite Assignment (fixes #424) (#432)
azz 1836e87
Build: changelog update for 14.0.0
8d71562
14.0.0
e9e7e22
Breaking: Support TypeScript 2.8 (fixes #453) (#454)
JamesHenry 886743b
Build: changelog update for 15.0.0
e1753d6
15.0.0
98c92f1
Fix: decorators removed on interface declarations (fixes #478) (#479)
muhanadra a18a4fd
Build: changelog update for 15.0.1
b380cc3
15.0.1
f58aa67
Breaking: Support TypeScript 2.9 (#480)
JamesHenry b99e919
Breaking: Set minimum node version to 6 (#481)
JamesHenry 853a06f
Build: changelog update for 16.0.0
2ba5dcc
16.0.0
86a60f1
Chore: Powerful integration tests and improved README (#483)
JamesHenry deeeb73
Chore: Loosen node version requirement in package.json (fixes #482) (…
JamesHenry 0db69b3
Fix: support ImportMeta (fixes #489) (#490)
ikatyang 3acd743
Fix: Snapshot all ecma-features fixtures (#495)
JamesHenry 92bd65c
Chore: Do not run integration tests within npm test
JamesHenry 13ff2ef
Build: changelog update for 16.0.1
071d1f4
16.0.1
6165cf9
Breaking: always set optional on ClassProperty (fixes #472) (#491)
ikatyang da70f19
Fix: error on multiple super classes (fixes #493) (#494)
ikatyang 10a4332
Breaking: Remove "Experimental" from rest and spread (fixes #428) (#429)
duailibe 0ccf3b2
Fix: support JSXSpreadChild (fixes #500) (#501)
ikatyang c3860b3
Build: changelog update for 17.0.0
114ed7c
17.0.0
e67219e
Chore: Replace removed API with public flags (fixes #498) (#505)
texastoland ce03ad7
Build: changelog update for 17.0.1
d0aaa7f
17.0.1
2c1709b
Fix: remove unnecessary TypeRef wrapper for ImportType (fixes #507) (…
ikatyang a9faa38
Breaking: Support TypeScript 3.0 (#504)
JamesHenry 1739f92
Build: changelog update for 18.0.0
4d85cf8
18.0.0
25f1dc7
Breaking: Use typescript-estree for parsing (#515)
JamesHenry 9e4afd9
Build: changelog update for 19.0.0
8fb1a7e
19.0.0
76174c0
Fix: Remove lib from package.json files (#518)
JamesHenry 9ea56f6
Build: changelog update for 19.0.1
ed1bb65
19.0.1
872e07b
Chore: Makefile tweaks (#522)
platinumazure 622188b
Fix: Re-expose parse method (fixes #519) (#521)
platinumazure bccf1e9
Build: changelog update for 19.0.2
ded2b80
19.0.2
f1a3432
Breaking: Support TypeScript 3.1 (fixes #524) (#525)
JamesHenry bd6b4d5
Build: changelog update for 20.0.0
027acaa
20.0.0
e4a9317
Upgrade: [email protected] (#527)
not-an-aardvark 6160a4d
New: Add visitor keys (#516)
michalsnik 0e340e5
Chore: Force LF for tsx files (#520)
uniqueiniquity bc7bbf8
Chore: Make ESLint a devDependency/peerDependency (fixes #523) (#526)
platinumazure 9a4e1bf
Build: changelog update for 20.1.0
c83b6d4
20.1.0
570b8ad
Revert "Chore: Make ESLint a devDependency/peerDependency (fixes #523…
platinumazure 42a2c34
Build: changelog update for 20.1.1
b7df04f
20.1.1
abb224f
Docs: add options to README (#530)
trusktr 6d7baf6
Breaking: typescript-estree v5 (#538)
kaicataldo d7997ee
Chore: test Node v11 in CI (#542)
kaicataldo 85ccea4
Breaking: make eslint a peerDep/devDep (#541)
kaicataldo 634384c
Breaking: switch 'jsx' option by filename (fixes #517) (#543)
mysticatea 5c3ce1a
Breaking: make 'useJSXTextNode:true' by default (#544)
mysticatea d4025b5
Update: add proper scope analysis (fixes #535) (#540)
mysticatea 87c3e83
Build: changelog update for 21.0.0
32106a6
21.0.0
a27fa12
Upgrade: eslint-release v1.2.0 (#549)
kaicataldo fb2122f
Fix: wrong reference on TSQualifiedName (fixes #550) (#551)
mysticatea a03fbca
Build: changelog update for 21.0.1
d40e0e0
21.0.1
3d1a2be
Fix: missing visitor-keys (#554)
armano2 079d110
Fix: crash in no-unused-vars when using enum (#556)
armano2 815f6b5
Fix: visitor-keys for TSAbstractClassProperty (#560)
armano2 aec2d79
Fix: visiting typeParameters in expressions (#565)
armano2 5576d81
Fix: visiting superTypeParameters in classes (#561)
armano2 04939f4
Fix: missing implements in classes (#562)
armano2 d4e2421
Fix: scope for TSImportEqualsDeclaration (#571)
armano2 574fea3
Fix: issue with global augmentation when tokens are not present (#574)
armano2 3ae0d0d
Docs: Update README.md (#567)
dudiharush 39958c8
Build: changelog update for 21.0.2
01e47b3
21.0.2
88cfcae
Breaking: typescript-estree to 18.0.0 and typescript to 3.2.1 (#596)
armano2 435ebf8
Fix: sourceType not correctly set in AST when provided in options. (#…
armano2 6aed53b
chore: chores after typescript-eslint-parser migration
JamesHenry 409cf82
chore: generate lcov coverage from typescript-eslint-parser
JamesHenry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
**What version of TypeScript are you using?** | ||
|
||
**What version of `typescript-eslint-parser` are you using?** | ||
|
||
**What code were you trying to parse?** | ||
|
||
```ts | ||
// Put your code here | ||
``` | ||
|
||
**What did you expect to happen?** | ||
|
||
**What happened?** |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
**/tests/fixtures/**/* | ||
**/dist | ||
**/coverage | ||
**/coverage | ||
|
||
# Temp ignore typescript-eslint-parser | ||
**/typescript-eslint-parser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
TypeScript ESLint Parser | ||
Copyright JS Foundation and other contributors, https://js.foundation | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# TypeScript ESLint Parser | ||
|
||
An ESLint custom parser which leverages [TypeScript ESTree](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/typescript-estree) to allow for ESLint to lint TypeScript source code. | ||
|
||
|
||
## Installation: | ||
|
||
```sh | ||
npm install --save-dev typescript-eslint-parser | ||
``` | ||
|
||
## Usage | ||
|
||
In your ESLint configuration file, set the `parser` property: | ||
|
||
```json | ||
{ | ||
"parser": "typescript-eslint-parser" | ||
} | ||
``` | ||
|
||
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. | ||
|
||
For example, once this parser successfully produces an AST for the TypeScript source code, it might well contain some information which simply does not exist in a standard JavaScript context, such as the data for a TypeScript-specific construct, like an `interface`. | ||
|
||
The core rules built into ESLint, such as `indent` have no knowledge of such constructs, so it is impossible to expect them to work out of the box with them. | ||
|
||
Instead, you also need to make use of one more plugins which will add or extend rules with TypeScript-specific features. | ||
|
||
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). | ||
|
||
## Configuration | ||
|
||
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. | ||
|
||
- **`jsx`** - default `false`. Enable parsing JSX when `true`. More details can be found [here](https://www.typescriptlang.org/docs/handbook/jsx.html). | ||
- It's `false` on `*.ts` files regardless of this option. | ||
- It's `true` on `*.tsx` files regardless of this option. | ||
- Otherwise, it respects this option. | ||
|
||
- **`useJSXTextNode`** - default `true`. Please set `false` if you use this parser on ESLint v4. If this is `false`, the parser creates the AST of JSX texts as the legacy style. | ||
|
||
### .eslintrc.json | ||
|
||
```json | ||
{ | ||
"parser": "typescript-eslint-parser", | ||
"parserOptions": { | ||
"jsx": true, | ||
"useJSXTextNode": true | ||
} | ||
} | ||
``` | ||
|
||
## Supported TypeScript Version | ||
|
||
We will always endeavor to support the latest stable version of TypeScript. | ||
|
||
The version of TypeScript currently supported by this parser is `~3.2.1`. 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. | ||
|
||
If you use a non-supported version of TypeScript, the parser will log a warning to the console. | ||
|
||
**Please ensure that you are using a supported version before submitting any issues/bug reports.** | ||
|
||
## Reporting Issues | ||
|
||
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: | ||
|
||
- ESLint Version | ||
- TypeScript version | ||
- The `typescript-eslint-parser` version | ||
- ESLint config or rules and plugins currently enabled | ||
|
||
## Integration Tests | ||
|
||
We have a very flexible way of running integration tests which connects all of the moving parts of the usage of this parser in the ESLint ecosystem. | ||
|
||
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. | ||
|
||
> 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! | ||
|
||
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. | ||
|
||
Then run: | ||
|
||
```sh | ||
npm run integration-tests | ||
``` | ||
|
||
If you ever need to change what gets installed when the docker images are built by docker-compose, you will first need to kill the existing containers by running: | ||
|
||
```sh | ||
npm run kill-integration-test-containers | ||
``` | ||
|
||
## Contributing | ||
|
||
Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/typescript-eslint-parser/issues). | ||
|
||
## Build Commands | ||
|
||
- `npm test` - run all linting and tests | ||
- `npm run lint` - run all linting | ||
- `npm run integration-tests` - run only integration tests | ||
|
||
## License | ||
|
||
TypeScript ESLint Parser is licensed under a permissive BSD 2-clause license. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.