1 | # TypeScript ESLint Parser
|
2 |
|
3 | A parser that converts TypeScript source code into an [ESTree](https://github.com/estree/estree)-compatible form.
|
4 |
|
5 | **Important:** This parser is not fully compatible with all ESLint rules and plugins. Some rules will improperly mark source code as failing or not find problems where it should.
|
6 |
|
7 | ## Supported TypeScript Version
|
8 |
|
9 | We will always endeavor to support the latest stable version of TypeScript.
|
10 |
|
11 | The version of TypeScript currently supported by this parser is `~2.7.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.
|
12 |
|
13 | If you use a non-supported version of TypeScript, the parser will log a warning to the console.
|
14 |
|
15 | **Please ensure that you are using a supported version before submitting any issues/bug reports.**
|
16 |
|
17 | ## Known Issues
|
18 |
|
19 | The following ESLint rules will fail on acceptable code:
|
20 | - no-undef [#416](https://github.com/eslint/typescript-eslint-parser/issues/416)
|
21 |
|
22 | The follow ESLint plugins have issues when used with this parser:
|
23 | - eslint-plugin-import
|
24 | - prefer-default-export - Will fail exports inside of Namespaces or Modules
|
25 |
|
26 | ## Usage
|
27 |
|
28 | Install:
|
29 |
|
30 | ```
|
31 | npm i typescript-eslint-parser --save-dev
|
32 | ```
|
33 |
|
34 | And in your ESLint configuration file:
|
35 |
|
36 | ```
|
37 | "parser": "typescript-eslint-parser"
|
38 | ```
|
39 |
|
40 | ## Help Wanted!
|
41 |
|
42 | If you're familiar with TypeScript and ESLint, and you'd like to see this project progress, please consider contributing. We need people with a good knowledge of TypeScript to ensure this parser is useful.
|
43 |
|
44 | ## Reporting Bugs
|
45 |
|
46 | Please check the current list of open and known issues and ensure the bug has not been reported before. When creating a new issue provide as much information about your environment as possible. This includes:
|
47 | - ESLint Version
|
48 | - TypeScript version
|
49 | - TypeScript parser version
|
50 | - ESLint config or rules and plugins currently enabled
|
51 |
|
52 | As well include a small code sample that can be used to reproduce the issue.
|
53 |
|
54 | ## Contributing
|
55 |
|
56 | 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).
|
57 |
|
58 | ## Build Commands
|
59 |
|
60 | * `npm test` - run all linting and tests
|
61 | * `npm run lint` - run all linting
|
62 | * `npm run ast-alignment-tests` - run only Babylon AST alignment tests
|
63 | * `npm run integration-tests` - run only integration tests
|
64 |
|
65 | ## License
|
66 |
|
67 | TypeScript ESLint Parser is licensed under a permissive BSD 2-clause license.
|