canirequire › Dual (CommonJS + ESM) › @eslint/eslintrc
Is @eslint/eslintrc ESM-only? Can you require() it?
The legacy ESLintRC config file format for ESLint
Last verified Sep 9, 2026 against @eslint/eslintrc@3.3.7. Markdown · JSON
Dual (CommonJS + ESM) Dual package — require() works on every Node.js version we test; import works too
@eslint/eslintrc publishes both a CommonJS entry and a native ESM entry (ESM added in 1.0.0). require("@eslint/eslintrc") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. The package declares Node.js ^18.18.0 || ^20.9.0 || >=21.1.0. import "@eslint/eslintrc" works alongside it.
What to do
- Nothing to change. require("@eslint/eslintrc") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. The package declares Node.js ^18.18.0 || ^20.9.0 || >=21.1.0. import * as eslintrc from "@eslint/eslintrc" works alongside it; use named imports for what the ESM entry exports.
- TypeScript: types are bundled; install nothing extra.
Does @eslint/eslintrc@3.3.7 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("@eslint/eslintrc") from a CommonJS file and import "@eslint/eslintrc" from an ES module.
| Runtime | require("@eslint/eslintrc") | import "@eslint/eslintrc" |
|---|---|---|
| Node.js 18 | ✓ works | ✓ 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 @eslint/eslintrc
ES modules (import)
import * as eslintrc from "@eslint/eslintrc";Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.
CommonJS (require)
const eslintrc = require("@eslint/eslintrc");Module format by version
Derived from the type, main and exports fields of every stable release on npm, corrected where a runtime test of that version contradicted them (51 versions; the newest 51 shown).
| Versions | Format | First published |
|---|---|---|
| 1.0.0 – 3.3.7 | Dual (CommonJS + ESM) | Aug 7, 2021 |
| 0.0.1 – 0.4.3 | CommonJS | Sep 1, 2020 |
Frequently asked
Is @eslint/eslintrc ESM-only?
@eslint/eslintrc@3.3.7 ships CommonJS and ESM builds. @eslint/eslintrc publishes both a CommonJS entry and a native ESM entry (ESM added in 1.0.0). require("@eslint/eslintrc") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. The package declares Node.js ^18.18.0 || ^20.9.0 || >=21.1.0. import "@eslint/eslintrc" works alongside it.
Can I require @eslint/eslintrc?
Yes. @eslint/eslintrc ships a CommonJS entry alongside the native ESM entry. require("@eslint/eslintrc") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. The package declares Node.js ^18.18.0 || ^20.9.0 || >=21.1.0.
Does @eslint/eslintrc work in Bun?
Yes. import "@eslint/eslintrc" loaded successfully in Bun 1.4.0 on Sep 9, 2026.
Does @eslint/eslintrc ship TypeScript types?
Yes. @eslint/eslintrc bundles its own type declarations; no @types package is needed.
Links
Other dual (commonjs + esm) packages
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- tslib 2.8.1Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
Similar popularity
- is-plain-obj 4.1.0ESM-only
- require-directory 2.1.1CommonJS
- ts-api-utils 2.5.0Dual
- whatwg-mimetype 5.0.0CommonJS
- proxy-from-env 2.1.0Dual
- doctrine 3.0.0CommonJS
- is-arrayish 0.3.4CommonJS
- tailwindcss 4.3.3Dual