Lints HTML snippets.
- Detects inconsistent tag structure.
npm install htmlinter
node node_modules/htmlint path/to/some.html
const htmlint = require('./htmlint');
htmlint.checkString('<a></b>').then((issues) => {
issues.forEach((issue) => {
console.log(issue.print());
});
});
// Output:
// Closing tag mismatch for <b> detected at line 1, column 4
// Unclosed element for <a> detected at line 1, column 1
const htmlint = require('./htmlint');
htmlint.checkString('path/to/some.html').then((issues) => {
issues.forEach((issue) => {
console.log(issue.print());
});
});
See ALE fork.
- Autoformat according to formatting rules.