{"id":18990,"library":"babel-eslint-parser","title":"@babel/eslint-parser","description":"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.","status":"active","version":"7.13.10","language":"javascript","source_language":"en","source_url":"https://github.com/babel/babel","tags":["javascript"],"install":[{"cmd":"npm install babel-eslint-parser","lang":"bash","label":"npm"},{"cmd":"yarn add babel-eslint-parser","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-eslint-parser","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for parsing; version >=7.11.0 for v7.x and >=7.26.0 for v8.x.","package":"@babel/core","optional":false},{"reason":"Peer dependency; ESLint >=7.5.0 for v7.x, ESLint >=9 for v8.x.","package":"eslint","optional":false}],"imports":[{"note":"The old babel-eslint package is deprecated. Use @babel/eslint-parser for Babel v7+.","wrong":"parser: \"babel-eslint\"","symbol":"parser (ESLint config)","correct":"parser: \"@babel/eslint-parser\""},{"note":"The parser property in ESLint config expects a string with the package name, not the @babel/core package.","wrong":"module.exports = { parser: \"@babel/core\" }","symbol":"eslintConfig (module.exports)","correct":"module.exports = { parser: \"@babel/eslint-parser\" }"},{"note":"Setting requireConfigFile to false allows linting files without a Babel config, useful for config files.","wrong":"parserOptions: { requireConfigFile: true }","symbol":"requireConfigFile option","correct":"parserOptions: { requireConfigFile: false }"}],"quickstart":{"code":"// .eslintrc.js\nmodule.exports = {\n  parser: \"@babel/eslint-parser\",\n  parserOptions: {\n    requireConfigFile: false,\n    babelOptions: {\n      presets: [\"@babel/preset-env\", \"@babel/preset-react\"],\n    },\n  },\n  rules: {\n    \"no-unused-vars\": \"warn\",\n  },\n};\n\n// Lint a file\n// npx eslint src/**/*.js","lang":"javascript","description":"Shows how to configure ESLint to use @babel/eslint-parser with Babel presets and a rule."},"warnings":[{"fix":"Upgrade ESLint to v9 or stay on @babel/eslint-parser v7.x.","message":"ESLint v7 and v8 support dropped in @babel/eslint-parser v8.0.0.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Remove any explicit references to 'experimental-worker' and use the default parser.","message":"The experimental-worker module has been made default in v8.0.0-rc.1.","severity":"breaking","affected_versions":">=8.0.0-rc.1"},{"fix":"Replace 'babel-eslint' with '@babel/eslint-parser' in devDependencies and ESLint config.","message":"babel-eslint (no @) is deprecated. Use @babel/eslint-parser instead.","severity":"deprecated","affected_versions":"*"},{"fix":"Add ecmaFeatures: { globalReturn: true } if using CommonJS modules.","message":"parserOptions.ecmaFeatures might still be needed for ESLint rules to recognize features like globalReturn.","severity":"gotcha","affected_versions":"*"},{"fix":"Create a Babel config or set requireConfigFile: false (not recommended for transformed code).","message":"Requires a valid Babel configuration file (babel.config.js, .babelrc, etc.) if requireConfigFile is true (default).","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install @babel/core --save-dev","cause":"Missing @babel/core peer dependency.","error":"Error: Could not find module '@babel/core'"},{"fix":"Upgrade ESLint to >=7.5.0 or remove requireConfigFile from parserOptions.","cause":"Using an old version of ESLint (<7.5.0) that does not support this parser option.","error":"Parsing error: Unknown parser option \"requireConfigFile\""},{"fix":"Match ESLint version to the parser version (e.g., ESLint 7 for @babel/eslint-parser v7).","cause":"Incompatible ESLint version; @babel/eslint-parser v7 requires ESLint >=7.5.0, v8 requires ESLint >=9.","error":"TypeError: this.getAncestors is not a function"},{"fix":"Create a Babel config file or set requireConfigFile: false.","cause":"requireConfigFile is true (default) but no Babel configuration is found.","error":"Error: No Babel config file detected for ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}