canirequire › ESM-only › @commitlint/config-conventional
Is @commitlint/config-conventional ESM-only? Can you require() it?
Shareable commitlint config enforcing conventional commits
Last verified Sep 9, 2026 against @commitlint/config-conventional@21.2.2. JSON
ESM-only ESM-only since 19.0.0 — last CommonJS version is 18.6.3
@commitlint/config-conventional dropped its CommonJS build in 19.0.0 (February 2024). The last version you can require() on every Node.js version, including 18 and older, is 18.6.3, published Mar 11, 2024.
On Node.js 20.19+, 22.12+ and every newer release, require("@commitlint/config-conventional") works anyway: Node can load synchronous ES modules through require(). Verified on Node 22, 24, 26. Node.js 18 and older still fail with ERR_REQUIRE_ESM.
@commitlint/config-conventional@21.2.2 declares engines ">=22.12.0", so Node.js 18, 20 are outside its supported range regardless of module format.
Does @commitlint/config-conventional@21.2.2 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("@commitlint/config-conventional") from a CommonJS file and import "@commitlint/config-conventional" from an ES module.
| Runtime | require("@commitlint/config-conventional") | import "@commitlint/config-conventional" |
|---|---|---|
| Node.js 18 | ✗ failsERR_REQUIRE_ESM | ✓ works |
| Node.js 20 | ✓ works | ✓ works |
| Node.js 22 | ✓ works | ✓ works |
| Node.js 24 | ✓ works | ✓ works |
| Node.js 26 | ✓ works | ✓ works |
| Bun 1.4 | ✓ works | ✓ works |
How to import @commitlint/config-conventional
ES modules (import)
import configConventional from "@commitlint/config-conventional";CommonJS (require)
// Node.js 20.19+ / 22.12+ / newer (package has no top-level await):
const configConventional = require("@commitlint/config-conventional");
// Any Node.js version:
const configConventional = await import("@commitlint/config-conventional");
// Or pin the last CommonJS release:
// npm install @commitlint/config-conventional@18.6.3Module format by version
Derived from the type, main and exports fields of every stable release on npm (107 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 19.0.0 – 21.2.2 | ESM-only | Feb 27, 2024 |
| 18.6.2 – 18.6.3 | Dual (CommonJS + ESM) | Feb 14, 2024 |
| 16.0.0 – 18.6.1 | CommonJS | Dec 26, 2021 |
Frequently asked
Is @commitlint/config-conventional ESM-only?
@commitlint/config-conventional@21.2.2 is ESM-only. @commitlint/config-conventional dropped its CommonJS build in 19.0.0 (February 2024). The last version you can require() on every Node.js version, including 18 and older, is 18.6.3, published Mar 11, 2024.
Which version of @commitlint/config-conventional still supports CommonJS / require()?
18.6.3 is the last version of @commitlint/config-conventional with a CommonJS build. Install it with "npm install @commitlint/config-conventional@18.6.3". Every version from 19.0.0 on is ESM-only.
How do I use @commitlint/config-conventional from a CommonJS file?
Use a dynamic import: const mod = await import("@commitlint/config-conventional"). On Node.js 20.19+, 22.12+ and newer, a plain require("@commitlint/config-conventional") also works for ESM packages that do not use top-level await. Alternatively pin @commitlint/config-conventional@18.6.3.
Does @commitlint/config-conventional work in Bun?
Yes. import "@commitlint/config-conventional" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does @commitlint/config-conventional ship TypeScript types?
Yes. @commitlint/config-conventional bundles its own type declarations; no @types package is needed.
Links
Other esm-only packages
- ansi-styles 7.0.0last CJS
5.2.0 - strip-ansi 7.2.0last CJS
6.0.1 - commander 15.0.0last CJS
14.0.3 - supports-color 11.0.0last CJS
8.1.1 - chalk 6.0.0last CJS
4.1.2 - tslib 2.8.1last CJS
2.5.2 - string-width 8.2.2last CJS
4.2.3 - ansi-regex 6.3.0last CJS
5.0.1
Similar popularity
- styled-components 6.5.3CommonJS
- polished 4.3.1CommonJS
- firebase 12.18.0Dual
- @babel/plugin-proposal-nullish-coalescing-operator 7.18.6CommonJS
- xlsx 0.18.5CommonJS
- update-notifier 7.3.1ESM-only
- webpack-bundle-analyzer 5.3.2CommonJS
- @svgr/webpack 8.1.0CommonJS