ESM import regression: `HTMLHint` named export no longer available in `htmlhint@1.8.1`
Open
@coliff is already working on this.
Since Feb 9, 2026.
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 474
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
Describe the bug
Since upgrading to htmlhint@1.8.1, importing HTMLHint as a named export in an ESM context throws an error indicating that the module does not provide the HTMLHint export.
In previous versions, the following ESM import worked:
import { HTMLHint } from "htmlhint";
With 1.8.1, Node.js reports that htmlhint is a CommonJS module and that the named export cannot be resolved.
To Reproduce
Environment:
- Node.js: v24.13.0
- OS: Windows (reproducible in other environments as well)
- Module system: ESM
Steps:
npm install --save-exact htmlhint@1.8.1
node --eval 'import { HTMLHint } from "htmlhint";'
Result:
SyntaxError: Named export 'HTMLHint' not found. The requested module 'htmlhint' is a CommonJS module...
Node suggests using:
import pkg from "htmlhint";
const { HTMLHint } = pkg;
Expected behavior
The following command should execute without error:
node --eval 'import { HTMLHint } from "htmlhint";'
—or the documentation / changelog should explicitly mention that named ESM imports are no longer supported if this is an intentional breaking change.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.