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.

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.
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"
npm install htmllint-cli
yarn add htmllint-cli
pnpm add htmllint-cli

Global install, initialize config, lint a single HTML file.

npm install -g htmllint-cli
cd my-project
htmllint init
# edit .htmllintrc as needed
htmllint index.html