npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

@hint/parser-html

3.0.1 • Public • Published

HTML (@hint/parser-html)

The HTML parser is built on top of jsdom so hints can analyze HTML files.

Note: This parser is currently only needed if using the local connector. Other connectors provide their own DOM to generate events instead.

To use it you will have to install it via npm:

npm install @hint/parser-html

Note: You can make npm install it as a devDependency using the --save-dev parameter, or to install it globally, you can use the -g parameter. For other options see npm's documentation.

And then activate it via the .hintrc configuration file:

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

Events emitted

This parser emits the event parse::end::html of type HTMLParse which has the following information:

  • document: an HTMLDocument object containing the parsed document.
  • html: a string containing the raw HTML source code.
  • resource: the parsed resource.

And the event parse::start::html of type Event which has the following information:

  • resource: the resource that is going to be parsed.

install

npm i @hint/parser-html

Downloadsweekly downloads

1,041

version

3.0.1

license

Apache-2.0

homepage

webhint.io

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability