canirequire

canirequireDual (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. JSON

Dual (CommonJS + ESM) Dual package — both require() and import work

@eslint/eslintrc publishes both a CommonJS entry and a native ESM entry (ESM added in 1.0.0). require("@eslint/eslintrc") and import "@eslint/eslintrc" both work on every supported Node.js version and in Bun.

Latest
3.3.7 (Sep 1, 2026)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
3.3.7
Native ESM since
1.0.0
TypeScript types
Bundled
Node engines
^18.18.0 || ^20.9.0 || >=21.1.0
License
MIT

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.

Runtimerequire("@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✓ works✓ works

How to import @eslint/eslintrc

ES modules (import)

import eslintrc from "@eslint/eslintrc";

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 (51 versions; the newest 51 shown).

VersionsFormatFirst published
1.0.0 – 3.3.7Dual (CommonJS + ESM)Aug 7, 2021
0.0.1 – 0.4.3CommonJSSep 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") and import "@eslint/eslintrc" both work on every supported Node.js version and in Bun.

Can I require @eslint/eslintrc?

Yes. @eslint/eslintrc ships a CommonJS entry, so require("@eslint/eslintrc") works on every Node.js version, alongside the native ESM entry for import.

Does @eslint/eslintrc work in Bun?

Yes. import "@eslint/eslintrc" loaded successfully in Bun 1.4 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

Similar popularity