# Is @commitlint/config-conventional ESM-only? Can you require() it?

> @commitlint/config-conventional@21.2.2 is ESM-only. ESM-only since 19.0.0 — last CommonJS version is 18.6.3.

Shareable commitlint config enforcing conventional commits

Last verified Sep 9, 2026 against @commitlint/config-conventional@21.2.2.

@commitlint/config-conventional dropped its CommonJS build in 19.0.0 (February 2024). The last version with a plain require()-able CommonJS entry is 18.6.3, published Mar 11, 2024; it declares support for Node.js >=v18.

On Node.js 22.12+ and newer (@commitlint/config-conventional@21.2.2 declares Node.js >=22.12.0), require("@commitlint/config-conventional") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 22, 24 and 26. Node.js 18 has no require(esm), and @commitlint/config-conventional@21.2.2 declares Node.js >=22.12.0, so 18 is outside its supported range anyway.

@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.

## What to do

1. On Node.js 22.12+ and newer (@commitlint/config-conventional@21.2.2 declares Node.js >=22.12.0), require("@commitlint/config-conventional") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 22, 24 and 26.
2. From a CommonJS file, use a dynamic import inside an async function: const configConventional = await import("@commitlint/config-conventional"). That works on every Node.js version the package supports (>=22.12.0).
3. If you need a synchronous require() or run Node.js 18: npm install @commitlint/config-conventional@18.6.3, the last CommonJS release (published Mar 11, 2024); it declares Node.js >=v18.
4. @commitlint/config-conventional@21.2.2 declares engines ">=22.12.0", so Node.js 18, 20 are unsupported regardless: upgrade Node.js or pin an older release.
5. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 21.2.2 (Aug 13, 2026)
- Module format: ESM-only
- Last CommonJS version: 18.6.3
- ESM-only since: 19.0.0 (Feb 27, 2024)
- TypeScript types: bundled
- Node engines: >=22.12.0
- Weekly downloads: 9.0M
- License: MIT

## Runtime test results for @commitlint/config-conventional@21.2.2

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 | fails (ERR_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.0 | works | works |

## How to import @commitlint/config-conventional

ES modules:

```js
import * as configConventional from "@commitlint/config-conventional";
```

Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.

CommonJS:

```js
// Node.js 22.12+ and newer (verified):
const configConventional = require("@commitlint/config-conventional");

// Any Node.js version the package supports (>=22.12.0), from an async function:
async function main() {
  const configConventional = await import("@commitlint/config-conventional");
}

// Or pin the last CommonJS release (declares Node.js >=v18):
// npm install @commitlint/config-conventional@18.6.3
```

## Module 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 with a plain require()-able CommonJS entry is 18.6.3, published Mar 11, 2024; it declares support for Node.js >=v18.

**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; it declares Node.js >=v18. 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?**

From a CommonJS file, use a dynamic import inside an async function: const configConventional = await import("@commitlint/config-conventional"). That works on every Node.js version the package supports (>=22.12.0). On Node.js 22.12+ and newer (@commitlint/config-conventional@21.2.2 declares Node.js >=22.12.0), require("@commitlint/config-conventional") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 22, 24 and 26. Alternatively pin @commitlint/config-conventional@18.6.3 (declares Node.js >=v18).

**Does @commitlint/config-conventional work in Bun?**

Yes. import "@commitlint/config-conventional" loaded successfully in Bun 1.4.0 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

- [@commitlint/config-conventional on npm](https://www.npmjs.com/package/@commitlint/config-conventional)
- [Source repository](https://github.com/conventional-changelog/commitlint)
- [HTML version](https://canirequire.com/package/@commitlint/config-conventional/)
- [JSON version](https://canirequire.com/package/@commitlint/config-conventional.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
