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. JSON
CommonJS CommonJS — require() works on every Node.js version
eslint-plugin-babel ships CommonJS only. require("eslint-plugin-babel") works everywhere. import "eslint-plugin-babel" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.
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 | ✗ 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)
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 is a CommonJS package. eslint-plugin-babel ships CommonJS only. require("eslint-plugin-babel") works everywhere. import "eslint-plugin-babel" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.
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 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
- eslint-plugin-json 5.0.0CommonJS
- gh-pages 6.3.0CommonJS
- jsdom-global 3.0.2CommonJS
- rollup-plugin-commonjs 10.1.0CommonJS
- commitlint 21.2.2ESM-only
- angular 1.8.3CommonJS
- uglifyjs-webpack-plugin 2.2.0CommonJS
- babel-plugin-lodash 3.3.4CommonJS