Registry / testing / babel-eslint-parser

babel-eslint-parser

JSON →
library7.13.10jsnpmunverified

An ESLint parser that leverages Babel's parser to lint all valid Babel code, including experimental and non-standard syntax (e.g., Flow, TypeScript). The current stable version is 7.29.2 (maintenance branch) with an 8.x release candidate targeting ESLint v9+. It requires @babel/core ≥7.11.0 and ESLint ≥7.5.0 (v7) or ESLint ≥9 (v8). Unlike alternatives like typescript-eslint, this parser supports the full range of Babel transforms and is maintained by the Babel core team. Release cadence is monthly for minor/patch versions.

npm install babel-eslint-parser
INSTALL
IMPORT
SIG · BABEL-ESLINT-PARSE
B
babel-eslint-parser
testingjavascriptv7.13.10
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parser (ESLint config)
parser: "@babel/eslint-parser"
parser: "babel-eslint"
The old babel-eslint package is deprecated. Use @babel/eslint-parser for Babel v7+.
eslintConfig (module.exports)
module.exports = { parser: "@babel/eslint-parser" }
module.exports = { parser: "@babel/core" }
The parser property in ESLint config expects a string with the package name, not the @babel/core package.
requireConfigFile option
parserOptions: { requireConfigFile: false }
parserOptions: { requireConfigFile: true }
Setting requireConfigFile to false allows linting files without a Babel config, useful for config files.

Shows how to configure ESLint to use @babel/eslint-parser with Babel presets and a rule.

// .eslintrc.js module.exports = { parser: "@babel/eslint-parser", parserOptions: { requireConfigFile: false, babelOptions: { presets: ["@babel/preset-env", "@babel/preset-react"], }, }, rules: { "no-unused-vars": "warn", }, }; // Lint a file // npx eslint src/**/*.js
Debug
Known issues
breakingESLint v7 and v8 support dropped in @babel/eslint-parser v8.0.0.
fix
Upgrade ESLint to v9 or stay on @babel/eslint-parser v7.x.
affects: >=8.0.0
breakingThe experimental-worker module has been made default in v8.0.0-rc.1.
fix
Remove any explicit references to 'experimental-worker' and use the default parser.
affects: >=8.0.0-rc.1
deprecatedbabel-eslint (no @) is deprecated. Use @babel/eslint-parser instead.
fix
Replace 'babel-eslint' with '@babel/eslint-parser' in devDependencies and ESLint config.
affects: *
gotchaparserOptions.ecmaFeatures might still be needed for ESLint rules to recognize features like globalReturn.
fix
Add ecmaFeatures: { globalReturn: true } if using CommonJS modules.
affects: *
gotchaRequires a valid Babel configuration file (babel.config.js, .babelrc, etc.) if requireConfigFile is true (default).
fix
Create a Babel config or set requireConfigFile: false (not recommended for transformed code).
affects: *
Errors
Common errors & fixes
Error: Could not find module '@babel/core'
Missing @babel/core peer dependency.
fix
npm install @babel/core --save-dev
Parsing error: Unknown parser option "requireConfigFile"
Using an old version of ESLint (<7.5.0) that does not support this parser option.
fix
Upgrade ESLint to >=7.5.0 or remove requireConfigFile from parserOptions.
TypeError: this.getAncestors is not a function
Incompatible ESLint version; @babel/eslint-parser v7 requires ESLint >=7.5.0, v8 requires ESLint >=9.
fix
Match ESLint version to the parser version (e.g., ESLint 7 for @babel/eslint-parser v7).
Error: No Babel config file detected for ...
requireConfigFile is true (default) but no Babel configuration is found.
fix
Create a Babel config file or set requireConfigFile: false.
Upgrade
Version history
7.13.10latest on npm
Audit
Dependencies
@babel/corerequiredPeer dependency required for parsing; version >=7.11.0 for v7.x and >=7.26.0 for v8.x.
eslintrequiredPeer dependency; ESLint >=7.5.0 for v7.x, ESLint >=9 for v8.x.
Agent activity
26 hits · last 30 days
node
24
OpenAI (training)
2
Resources
babel-eslint-parser — npm install babel-eslint-parser · libregistry