1.0.25 • Published 11 months ago

@hint/parser-typescript v1.0.25

Weekly downloads
4,273
License
Apache-2.0
Repository
github
Last release
11 months ago

TypeScript (@hint/parser-typescript)

The typescript parser emits the same events as @hint/parser-javascript so existing hints targeting JavaScript files can analyze TypeScript files without modification. Existing hints targeting HTML files can also analyze TSX content without modification if @hint/parser-jsx is active in addition to this parser.

This package is installed automatically by webhint:

npm install hint --save-dev

To use it, activate it via the .hintrc configuration file:

{
    "connector": {...},
    "formatters": [...],
    "hints": {
        ...
    },
    "parsers": ["jsx", "typescript"],
    ...
}

Note: The recommended way of running webhint is as a devDependency of your project.

Events emitted

This parser emits the following events:

  • parse::start::javascript of type Event which contains the following information:

    • resource: the resource we are going to parse.
  • parse::end::javascript, of type ScriptParse which contains the following information:

    • ast: an ESTree AST generated from the script.
    • element: an HTMLElement reference if the source was inline in HTML; null otherwise.
    • resource: the parsed resource. If the script is in a script tag and not a file, the value will refer to the HTML document containing the script.
    • sourceCode: the raw source code that was parsed.
    • tokens: a list of tokens generated from the source code.
    • walk: helper methods for walking the AST.
1.0.25

11 months ago

1.0.24

1 year ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago