HTML linter for legacy/modern HTML, Web Components, SVG, MathML, AMP HTML and more.
$ yarn add markuplint
$ markuplint verifyee.html
$ markuplint --help
Usage
$ markuplint <HTML file pathes (glob format)>
$ <stdout> | markuplint
Options
--ruleset, -r FILE_PATH Ruleset file path.
--no-color, -c Output no color.
--format, -f FORMAT Output format. Support "JSON" or "Simple". Default "JSON".
--problem-only, -p Output only problems, without passeds.
--help, -h Show help.
--version, -v Show version.
Examples
$ markuplint verifyee.html --ruleset path/to/.markuplintrc
$ cat verifyee.html | markuplint
import * as markuplint from 'markuplint';
const reports = await markuplint.verify(html, ruleset, rules);
// or
const { html, reports } = await markuplint.verifyFile(htmlPath, ruleset, rules);
.markuplintrc
JSON or YAML format
{
"extends": "markuplint/html-ls",
"rules": {
"rule-name": true,
"rule-name2": false,
"rule-name3": ["error", "VALUE"],
"rule-name4": ["warning", "VALUE", { "OPTIONAL_PROP": "OPTIONAL_VALUE" }]
},
"nodeRules": [
{
"tagName": "div",
"rules": {
"rule-name": false,
}
}
],
"childNodeRules": [
{
"selector": "[data-attr^=\"value\"]",
"inheritance": true,
"rules": {
"rule-name3": ["warning", "ANOTHER_VALUE"],
}
}
]
}
Editor | Page | Author |
---|---|---|
Visual Studio Code | @YusukeHirao | |
Atom | @YusukeHirao | |
Vim | @heavenshell |
This linter is inspired by: