htmlhint / htmlhint/HTMLHint

ESM import regression: `HTMLHint` named export no longer available in `htmlhint@1.8.1`

Open
#1,800 7 comments 2 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.