@hint/parser-typescript v1.0.26
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-devTo 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::javascriptof typeEventwhich contains the following information:resource: the resource we are going to parse.
parse::end::javascript, of typeScriptParsewhich contains the following information:ast: anESTreeAST generated from the script.element: anHTMLElementreference if the source was inline in HTML;nullotherwise.resource: the parsed resource. If the script is in ascript tagand 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 year ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago