canirequire

canirequireESM-only › @antfu/eslint-config

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

Anthony's ESLint config

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

ESM-only ESM-only since 4.0.0 — last CommonJS version is 3.16.0

@antfu/eslint-config dropped its CommonJS build in 4.0.0 (January 2025). The last version you can require() on every Node.js version, including 18 and older, 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 matrix below for the exact error.

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
License
MIT

Does @antfu/eslint-config@9.5.1 actually load? Runtime test results

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.

Runtimerequire("@antfu/eslint-config")import "@antfu/eslint-config"
Node.js 18✗ failsERR_REQUIRE_ESM✗ failsSyntaxError
Node.js 20✗ failsTypeError✗ failsTypeError
Node.js 22✓ works✓ works
Node.js 24✓ works✓ works
Node.js 26✓ works✓ works
Bun 1.4✓ works✓ works

How to import @antfu/eslint-config

ES modules (import)

import eslintConfig from "@antfu/eslint-config";

CommonJS (require)

// Node.js 20.19+ / 22.12+ / newer (package has no top-level await):
const eslintConfig = require("@antfu/eslint-config");

// Any Node.js version:
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).

VersionsFormatFirst published
4.13.3 – 9.5.1ESM-onlyJun 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 you can require() on every Node.js version, including 18 and older, 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?

Use a dynamic import: const mod = await import("@antfu/eslint-config"). On Node.js 20.19+, 22.12+ and newer, a plain require("@antfu/eslint-config") also works for ESM packages that do not use top-level await. 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 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

Other esm-only packages

Similar popularity