webhint parser needed to analyze JavaScript files
npm install @hint/parser-javascript@hint/parser-javascript)The javascript parser allows hints to analyze JavaScript files.
This package is installed automatically by webhint:
``bash`
npm install hint --save-dev
To use it, activate it via the [.hintrc][hintrc] configuration file:
`json`
{
"connector": {...},
"formatters": [...],
"hints": {
...
},
"parsers": ["javascript"],
...
}
Note: The recommended way of running webhint is as a devDependency of
your project.
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 inlinenull
in HTML; otherwise.resource
* : the parsed resource. If the JavaScript is inscript tag
a and not a file, the value will refer to thesourceCode
HTML document containing the script.
* : the raw source code that was parsed.tokens
* : a list of tokens generated from the source code.walk`: helper methods for walking the AST.
*
[hintrc]: https://webhint.io/docs/user-guide/configuring-webhint/summary/