canirequire › ESM-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.
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.
| Runtime | require("@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.0Module 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 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
- 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
- @vue/cli-plugin-eslint 5.0.9CommonJS
- @babel/plugin-proposal-throw-expressions 8.0.1ESM-only
- @storybook/manager-webpack5 6.5.16CommonJS
- @babel/plugin-external-helpers 8.0.1ESM-only
- @storybook/preset-create-react-app 10.6.0ESM-only
- @rollup/plugin-url 8.0.2Dual
- @webcomponents/webcomponentsjs 2.8.0CommonJS
- @size-limit/preset-small-lib 13.0.3ESM-only