All notable changes to hihtml are documented in this file, which is (mostly) AI-generated and (always) human-edited. Dependency updates may or may not be called out specifically.
The format is based on Keep a Changelog, and the project adheres to Semantic Versioning.
- Ensured to fail with a message and a non-zero exit when the input path doesn’t exist or can’t be read; a scripted run pointing at a mistyped path now fails instead of passing
- Changed an unusable setting or an unreadable settings file to exit
1, like every other input hihtml can’t work with;2is now reserved for a run that fails on its own, such as a checker that can’t be loaded - Renamed the positional argument to
pathin the help output, matching that it takes a directory or a single file
- Accepted the input path (directory or file) as a positional argument (e.g.,
hihtml src), which previously errored out- Adjusted to reject a
--reportvalue that doesn’t end with a.jsonfilename
- Adjusted to reject a
- Forced update with the latest dependencies
- Renamed the default settings file from .hihtml.json to hihtml.config.json, following the “.config” convention (.hihtml.json remains supported as a fallback, so existing setups keep working)
- Forced update with the latest dependencies
- Forced update with the latest dependencies
- Fixed
--quietand--reporthint, no longer suggesting-rwhen already in use - Fixed symlinked HTML files being silently skipped during directory traversal; symlinked files whose target resolves within the scanned root are now followed (symlinks pointing outside the root or to directories are skipped)
- Fixed malformed config values (e.g., non-numeric
links.timeout, non-booleanlinks.warnOnPermanentRedirects) now producing clear error messages instead of silent undefined behavior
- Clarified in documentation that ObsoHTML warnings are informational (and exit
0)
- Improved end-of-section summaries across all check types:
- Validation and deprecated markup sections now end with a line like “30 files validated · 17 with issues, 13 clean” (previously only the clean-file count was shown)
- Link check summary now includes the per-file breakdown (e.g., “19 with issues, 11 clean”) inline, replacing the separate floating “x files: no issues” line; also fixed “3 broken” → “3 broken links”
- Numbered output sections when more than one is shown (e.g., “1. Validation”, “2. Deprecated markup”), with the number repeated on the summary line for easier scanning in long output
- Added string-based functions to programmatic API:
checkCodeString(content, options?)validates an HTML string and checks it for deprecated markup, mirroringcheckCodefor string-based pipelinescheckLinksString(content, options?)checks all external http/https URLs found in an HTML string, mirroringcheckLinksfor string-based pipelinesminifyString(content, options?)minifies an HTML string and returns it, without any file I/O—useful in content-pipeline contexts such as Eleventy transforms, middleware, and SSR handlers
- Extended URL extraction in link checking to also detect URLs in unquoted attributes (e.g.,
href=https://example.com, which is valid HTML)
- Improved performance across several areas:
- Directory traversal now fans out subdirectories in parallel (
Promise.all) HtmlValidateinstances are cached per preset, avoiding re-initialization across calls tovalidate()/checkCode()- URL-extraction regexes in the link checker are compiled once at module load instead of per-call; extraction now uses
matchAll - HTML Minifier Next import and preset resolution are cached per preset, avoiding repeated work across calls to
minifyString() - Ignore-list entries are pre-classified into hostnames (Set) and prefix entries once per
checkLinks()call, enabling O(1) exact-hostname lookup in the hot path
- Directory traversal now fans out subdirectories in parallel (
- Added
validation.ignore, a list of HTML-validate rule IDs to suppress, mirroringlinks.ignore- Ignored messages appear in validation output (marked as ignored) but are not counted as errors and do not block minification when using
--all/-a - Supported in configuration (.hihtml.json/package.json) and programmatically via
checkCode(files, { ignore: […] }) ResultCodeValidationnow includescountIgnored;MessageValidationnow includesignored?: boolean
- Ignored messages appear in validation output (marked as ignored) but are not counted as errors and do not block minification when using
- Added
-s/--settings <file>flag to load configuration from a specific JSON file, overriding the default CWD config lookup- Accepts any JSON file, reading the
"hihtml"key if present (same convention as package.json), otherwise using the root object loadConfig()now accepts an optionalfilePathparameter for the same behavior programmatically
- Accepts any JSON file, reading the
- Added
-q/--quietflag to suppress all output when no issues are found, for cleaner CI and script usage - Enhanced progress indicators to show a color-coded dot: blue while processing, green on completion when no issues are found, yellow when issues are found
- Fixed link extraction incorrectly truncating URLs that contain an apostrophe inside a double-quoted
hrefattribute (e.g.,href="https://example.com/you_aren't_gonna_need_it")
- Renamed
-c/--checkto-c/--check-codefor clarity, paralleling-l/--check-links; updated--alldescription accordingly - Renamed programmatic API:
check→checkCode; updated adapter filenames (check.js→check-code.js,checklinks.js→check-links.js) for consistency - Updated default-mode preamble to “Checking for HTML code issues”
- Updated report
commandfield (check→check-code) and results key (check→checkCode)
- Added
-l/--check-linksflag to check all http/https links for broken URLs (4xx/5xx responses); exits 1 when broken links are found- Link checking is also included automatically in
--all/-a(after validation, before minification) - Programmatic
checkLinks()API: extracts unique http/https URLs from HTML files, checks each once via HEAD (with GET fallback on 405), follows redirects, and maps results back per file; supportstimeout,concurrency,warnOnPermanentRedirects, andignoreoptions linksconfiguration section in .hihtml.json/package.json fortimeout,concurrency,warnOnPermanentRedirects, andignorelinks.ignore: list of hostnames or URL prefixes to skip; ignored URLs appear as skipped in output and do not affect the exit code
- Link checking is also included automatically in
- Allowed mode flags to be freely combined;
--all/-atakes precedence when used alongside other mode flags - Adjusted output to only list files with issues per section; clean files are collapsed into a single “N files: no issues” summary line
- Ensured running without flags prints a short preamble noting what is being checked, pointing to
-aand-h
- Cut directory exclusion defaults to node_modules and .git folders
- Renamed and simplified programmatic API:
collectFiles→collect,readFiles→read,minifyFiles→minify; mergedvalidateFilesandcheckFilesinto a singlecheckthat mirrors--checkCLI behavior and returns{ validation, deprecation }
- Released initial version