[](https://badge.fury.io/js/%40coyote-labs%2Fhtml-lint) [](https://github.com/coyote-labs/html-lint/)
npm install @coyote-labs/html-lint 
> A meaningful static analysis tool for HTML
html-lint is a linter for HTML files. It uses
reshape to analyse
your HTML and provides feedback to make your HTML better.
* Only meaningful rules
* Fully extensible using custom rules
* Contextual feedback
``bash`
yarn add -D @coyote-labs/html-lint
`bash`
node_modules/.bin/html-lint build/*/.html
You can also use this programmatically.
`js
const { htmlLint } = require('@coyote-labs/html-lint');
(async() => {
try {
// it accepts glob patterns or an array of file paths.
await htmlLint('dist/*.html');
} catch (error) {
console.log(error)
}
})();
`
html-lint loads the following configuration files if they are present:
* An html-lint property in package.json..html-lintrc
* A file in JSON or YAML format..html-lintrc.json
* A , .html-lintrc.yaml, .html-lintrc.yml,.html-lintrc.js
or file..html-lint.config.js
* A file exporting a JS object.
The configuration file can be used to toggle rules. The allowed levels
are on, off and warn.
For example,
`js`
{
'doctype-first': 'on',
'class-ad-disabled': 'off',
'src-not-empty': 'warn'
}
You can also use this file to configure custom rules, if any.
`js`
{
'class-ad-disabled': 'off',
'custom-rules': {
'dir': 'my-custom-rules',
'rules': {
'custom-rule-one': 'error',
'custom-rule-two': 'warn'
}
}
}
File level rule configuration is also possible. For example,
`html``