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

1.0.31 • Public • Published

SASS (@hint/parser-sass)

The SASS parser is built on top of PostCSS so hints can analyze SASS and SCSS files. It emits the same events as @hint/parser-css so existing hints targeting CSS files will work without modification.

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": ["sass"],
    ...
}

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

Events emitted

This parser emits the following events:

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

    • resource: the resource we are going to parse.
  • parse::end::css of type StyleParse which has the following information:

    • ast: a PostCSS Root object containing the AST. See the PostCSS walk* APIs for help navigating the AST.
    • code: a string containing the raw stylesheet source code.
    • element: an HTMLElement reference if the source was inline in HTML; null otherwise.
    • resource: the parsed resource. If the CSS is in a style tag and not a file, the value will refer to the HTML document containing the stylesheet.

Limitations

This parser is not fault-tolerant (unlike @hint/parser-css) so only well-formed files will be parsed.

Package Sidebar

Install

npm i @hint/parser-sass

Homepage

webhint.io/

Weekly Downloads

15,083

Version

1.0.31

License

Apache-2.0

Unpacked Size

18.3 kB

Total Files

6

Last publish

Collaborators

  • leotlee
  • vidorteg
  • oaflynn
  • molant
  • antross