htmllint-cli
raw JSON → 0.0.7 verified Sat Apr 25 auth: no javascript deprecated
Command-line interface for htmllint, an HTML linter. Version 0.0.7 (as of last release). This package provides a CLI tool to lint HTML files against configurable rules via a .htmllintrc file. It is a thin wrapper around the htmllint library, with basic glob support and an init command. Development appears inactive (last updated long ago), and it requires Node >=4. Compared to alternatives like HTMLHint, this package has limited features and no recent updates.
Common errors
error Error: Cannot find module 'htmllint' ↓
cause Missing peer dependency htmllint; npm <7 does not auto-install peer deps.
fix
Run npm install -g htmllint-cli htmllint
error SyntaxError: Unexpected token } in JSON at position ... ↓
cause Invalid JSON in .htmllintrc configuration file.
fix
Validate .htmllintrc with a JSON linter or use jsonlint.
Warnings
deprecated htmllint-cli is no longer actively maintained; use an alternative like HTMLHint or a more modern linter. ↓
fix Migrate to HTMLHint (npm install htmlhint) or other active HTML linters.
breaking The init command may overwrite existing .htmllintrc without warning. ↓
fix Backup existing .htmllintrc before running htmllint init.
gotcha Glob patterns are expanded by the shell, not by htmllint-cli; ensure proper quoting in some environments. ↓
fix Use quotes for globs: htmllint "**/*.html"
Install
npm install htmllint-cli yarn add htmllint-cli pnpm add htmllint-cli Imports
- default export wrong
const htmllint = require('htmllint')correctimport htmllint from 'htmllint'
Quickstart
npm install -g htmllint-cli
cd my-project
htmllint init
# edit .htmllintrc as needed
htmllint index.html