template-lint
TypeScript icon, indicating that this package has built-in type declarations

0.8.12 • Public • Published

template-lint

logo

Sanity check of template HTML.

NPM version NPM downloads Travis Status Breaks-on Stability Gitter

Info

This project was the result of wondering why aurelia applications had missing content when you used self-closing tags. In the end it turns out if your template html is ill formed, the browser parser will not complain and you will simply have missing content and/or an ill formed DOM element tree.

See:

The intended goal of this work is to sanity check your template html during the development cycle to highlight potential problems.

This project serves as the basis for checking html and can be extended upon for different template flavors.

Rules

There are currently four rules bundled with this package:

  • SelfClose
    • ensure non-void elements do not self-close
  • Parser
    • returns errors for unclosed or ill-matched elements, as captured during parsing
  • ObsoleteTag
    • identify obsolete tag usage
  • ObsoleteAttributes
    • identify obsolete attrubute usage

Usage

For use with gulp, there is a gulp plugin available

Compiling

Clone the repository. In the project root run

npm install
npm test

VS-Code

Once installed, you can use make use of VS-Code launcher (ctrl + f5). Also allows you to place breakpoints on ts spec files (currently only for those files in outDir path in launch.json

Icon

Icon courtesy of The Noun Project

/template-lint/

    Package Sidebar

    Install

    npm i template-lint

    Weekly Downloads

    191

    Version

    0.8.12

    License

    (Apache-2.0)

    Last publish

    Collaborators

    • aureliaeffect
    • meirionhughes