canirequire

canirequire › CommonJS › eslint-plugin-babel

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

an eslint rule plugin companion to babel-eslint

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

CommonJS CommonJS on paper — require() failed in our runtime test

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.
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

Does eslint-plugin-babel@5.3.1 actually load? Runtime test results

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.

Runtimerequire("eslint-plugin-babel")import "eslint-plugin-babel"
Node.js 18✗ failsTypeError✗ failsTypeError
Node.js 20✗ failsTypeError✗ failsTypeError
Node.js 22✗ failsTypeError✗ failsTypeError
Node.js 24✗ failsTypeError✗ failsTypeError
Node.js 26✗ failsTypeError✗ failsTypeError
Bun 1.4.0✗ failsTypeError✗ failsTypeError

A failing require() on a CommonJS package usually means the package needs a browser/DOM global, a peer dependency, or a native binary that is not available in a bare Node.js process.

How to import eslint-plugin-babel

ES modules (import)

import eslintPluginBabel from "eslint-plugin-babel";

Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.

CommonJS (require)

// 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, corrected where a runtime test of that version contradicted them (22 versions; the newest 22 shown).

VersionsFormatFirst published
1.0.0 – 5.3.1CommonJSJun 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

Other commonjs packages

Similar popularity