@hint/parser-typescript
TypeScript icon, indicating that this package has built-in type declarations

1.0.26 • Public • Published

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.2617,624latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.2617,624
1.0.25301
1.0.2440
1.0.2377
1.0.2226
1.0.2118
1.0.203
1.0.192
1.0.189
1.0.171
1.0.163
1.0.1511
1.0.140
1.0.131
1.0.1222
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.5178
1.0.4353
1.0.36
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i @hint/parser-typescript

Homepage

webhint.io/

Weekly Downloads

18,675

Version

1.0.26

License

Apache-2.0

Unpacked Size

18.4 kB

Total Files

6

Last publish

Collaborators

  • leotlee
  • vidorteg
  • oaflynn
  • molant
  • antross