# Is @antfu/eslint-config ESM-only? Can you require() it?

> @antfu/eslint-config@9.5.1 is ESM-only. ESM-only since 4.0.0 — last CommonJS version is 3.16.0.

Anthony's ESLint config

Last verified Sep 9, 2026 against @antfu/eslint-config@9.5.1.

@antfu/eslint-config dropped its CommonJS build in 4.0.0 (January 2025). The last version with a plain require()-able CommonJS entry is 3.16.0, published Jan 22, 2025.

require("@antfu/eslint-config") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it. On Node.js 18, which has no require(esm), require("@antfu/eslint-config") fails with ERR_REQUIRE_ESM.

## What to do

1. require("@antfu/eslint-config") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it.
2. From a CommonJS file, use a dynamic import inside an async function: const eslintConfig = await import("@antfu/eslint-config"). That works on every Node.js version the package supports.
3. If you need a synchronous require() or run Node.js 18: npm install @antfu/eslint-config@3.16.0, the last CommonJS release (published Jan 22, 2025).
4. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 9.5.1 (Sep 2, 2026)
- Module format: ESM-only
- Last CommonJS version: 3.16.0
- ESM-only since: 4.0.0 (Jan 25, 2025)
- TypeScript types: bundled
- Node engines: not declared
- Weekly downloads: 448K
- License: MIT

## Runtime test results for @antfu/eslint-config@9.5.1

Installed and executed on Sep 9, 2026 with require("@antfu/eslint-config") from a CommonJS file and import "@antfu/eslint-config" from an ES module.

| Runtime | require("@antfu/eslint-config") | import "@antfu/eslint-config" |
|---|---|---|
| Node.js 18 | fails (ERR_REQUIRE_ESM) | fails (SyntaxError) |
| Node.js 20 | fails (TypeError) | fails (TypeError) |
| Node.js 22 | works | works |
| Node.js 24 | works | works |
| Node.js 26 | works | works |
| Bun 1.4.0 | works | works |

## How to import @antfu/eslint-config

ES modules:

```js
import * as eslintConfig from "@antfu/eslint-config";
```

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

CommonJS:

```js
// require("@antfu/eslint-config") failed in our probe on Node.js 20.19+, 22.12+ and newer as well; see the runtime table.

// Any Node.js version the package supports, from an async function:
async function main() {
  const eslintConfig = await import("@antfu/eslint-config");
}

// Or pin the last CommonJS release:
// npm install @antfu/eslint-config@3.16.0
```

## Module format by version

Derived from the type, main and exports fields of every stable release on npm (348 versions; the newest 60 shown).

| Versions | Format | First published |
|---|---|---|
| 4.13.3 – 9.5.1 | ESM-only | Jun 4, 2025 |

## Frequently asked

**Is @antfu/eslint-config ESM-only?**

@antfu/eslint-config@9.5.1 is ESM-only. @antfu/eslint-config dropped its CommonJS build in 4.0.0 (January 2025). The last version with a plain require()-able CommonJS entry is 3.16.0, published Jan 22, 2025.

**Which version of @antfu/eslint-config still supports CommonJS / require()?**

3.16.0 is the last version of @antfu/eslint-config with a CommonJS build. Install it with "npm install @antfu/eslint-config@3.16.0". Every version from 4.0.0 on is ESM-only.

**How do I use @antfu/eslint-config from a CommonJS file?**

From a CommonJS file, use a dynamic import inside an async function: const eslintConfig = await import("@antfu/eslint-config"). That works on every Node.js version the package supports. require("@antfu/eslint-config") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it. Alternatively pin @antfu/eslint-config@3.16.0.

**Does @antfu/eslint-config work in Bun?**

Yes. import "@antfu/eslint-config" loaded successfully in Bun 1.4.0 on Sep 9, 2026.

**Does @antfu/eslint-config ship TypeScript types?**

Yes. @antfu/eslint-config bundles its own type declarations; no @types package is needed.

## Links

- [@antfu/eslint-config on npm](https://www.npmjs.com/package/@antfu/eslint-config)
- [Source repository](https://github.com/antfu/eslint-config)
- [HTML version](https://canirequire.com/package/@antfu/eslint-config/)
- [JSON version](https://canirequire.com/package/@antfu/eslint-config.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.
