# Is eslint-plugin-babel ESM-only? Can you require() it?

> eslint-plugin-babel@5.3.1 declares a CommonJS entry, but require() fails at runtime. CommonJS on paper — require() failed in our runtime test.

an eslint rule plugin companion to babel-eslint

Last verified Sep 9, 2026 against eslint-plugin-babel@5.3.1.

eslint-plugin-babel declares a CommonJS entry only, but require("eslint-plugin-babel") failed on every Node.js version in our probe: TypeError: (intermediate value).getRules is not a function. import "eslint-plugin-babel" resolves to the same file, so it fails the same way. That usually means a missing peer dependency, a browser-only global, or a package that is not meant to be loaded directly; see the runtime table below.

## What to do

1. require("eslint-plugin-babel") failed in our probe on every Node.js version (TypeError: (intermediate value).getRules is not a function); check the package README for peer dependencies or setup before relying on it.
2. From ES modules use the default import: import eslintPluginBabel from "eslint-plugin-babel"; then destructure. Named imports only work when Node.js can statically detect the exports.
3. TypeScript: no types are available for eslint-plugin-babel; declare the module yourself if you need them.

## Facts

- Latest: 5.3.1 (Jun 30, 2020)
- Module format: CommonJS
- Last CommonJS version: 5.3.1
- TypeScript types: none
- Node engines: >=4
- Weekly downloads: 531K
- License: MIT

## Runtime test results for eslint-plugin-babel@5.3.1

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

| Runtime | require("eslint-plugin-babel") | import "eslint-plugin-babel" |
|---|---|---|
| Node.js 18 | fails (TypeError) | fails (TypeError) |
| Node.js 20 | fails (TypeError) | fails (TypeError) |
| Node.js 22 | fails (TypeError) | fails (TypeError) |
| Node.js 24 | fails (TypeError) | fails (TypeError) |
| Node.js 26 | fails (TypeError) | fails (TypeError) |
| Bun 1.4.0 | fails (TypeError) | fails (TypeError) |

## How to import eslint-plugin-babel

ES modules:

```js
import eslintPluginBabel from "eslint-plugin-babel";
```

CommonJS:

```js
// require("eslint-plugin-babel") failed in our probe on every Node.js version we test (TypeError: (intermediate value).getRules is not a function); see the runtime table.
const eslintPluginBabel = require("eslint-plugin-babel");
```

## Module format by version

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

| Versions | Format | First published |
|---|---|---|
| 1.0.0 – 5.3.1 | CommonJS | Jun 19, 2015 |

## Frequently asked

**Is eslint-plugin-babel ESM-only?**

eslint-plugin-babel@5.3.1 declares a CommonJS entry, but require() fails at runtime. eslint-plugin-babel declares a CommonJS entry only, but require("eslint-plugin-babel") failed on every Node.js version in our probe: TypeError: (intermediate value).getRules is not a function. import "eslint-plugin-babel" resolves to the same file, so it fails the same way. That usually means a missing peer dependency, a browser-only global, or a package that is not meant to be loaded directly; see the runtime table below.

**Can I require eslint-plugin-babel?**

Not in practice. eslint-plugin-babel declares a CommonJS entry, but require("eslint-plugin-babel") failed on every Node.js version in our probe: TypeError: (intermediate value).getRules is not a function. Check the package README for peer dependencies or setup before relying on it.

**Can I import eslint-plugin-babel with ES module syntax?**

Yes. import eslintPluginBabel from "eslint-plugin-babel" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

**Does eslint-plugin-babel work in Bun?**

Importing eslint-plugin-babel failed in Bun 1.4.0 on Sep 9, 2026: TypeError: new eslint.Linter().getRules is not a function. (In 'new eslint.Linter().getRules()', 'new eslint.Linter().getRules' is undefined)

**Does eslint-plugin-babel ship TypeScript types?**

No. eslint-plugin-babel ships no type declarations and there is no @types package for it.

## Links

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