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
- 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.
- 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.
- TypeScript: no types are available for eslint-plugin-babel; declare the module yourself if you need them.
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.
| Runtime | require("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).
| 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
Other commonjs packages
- debug 4.4.3CommonJS
- semver 7.8.5CommonJS
- ms 2.1.3CommonJS
- picomatch 4.0.7CommonJS
- ajv 8.20.0CommonJS
- source-map 0.8.0CommonJS
- react-is 19.2.8CommonJS
- readable-stream 4.7.0CommonJS
Similar popularity
- @storybook/testing-library 0.2.2CommonJS
- jsdom-global 3.0.2CommonJS
- @material-ui/icons 4.11.3CommonJS
- rollup-plugin-commonjs 10.1.0CommonJS
- commitlint 21.2.2No entry
- angular 1.8.3CommonJS
- uglifyjs-webpack-plugin 2.2.0CommonJS
- babel-plugin-lodash 3.3.4CommonJS