{"id":19694,"library":"eslint-plugin-babel","title":"eslint-plugin-babel","description":"An ESLint plugin companion to babel-eslint that re-implements core ESLint rules to handle Babel experimental features such as decorators, optional chaining, class properties, do expressions, BigInt, and JSX fragment syntax. Version 5.3.1 is the latest stable release; it requires ESLint >=4.0.0 and Node >=4. The plugin replaces problematic built-in rules with Babel-aware versions to avoid false positives/negatives, and several older rules have been deprecated in favor of native ESLint rules or eslint-plugin-flowtype. It uses eslint-rule-composer for rule composition, is actively maintained, and supports autofix for some rules (marked with 🛠).","status":"active","version":"5.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/babel/eslint-plugin-babel","tags":["javascript","babel","eslint","eslintplugin","eslint-plugin","babel-eslint"],"install":[{"cmd":"npm install eslint-plugin-babel","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-babel","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-babel","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"used internally to compose rules (since v5.0.0)","package":"eslint-rule-composer","optional":false}],"imports":[{"note":"Replace core 'new-cap' with 'babel/new-cap' to ignore capitalized decorators.","wrong":"// wrong: using core rule with Babel code - false positives on decorators","symbol":"babel/new-cap","correct":"// In .eslintrc: \"rules\": { \"babel/new-cap\": \"error\" }"},{"note":"Supports optional chaining without false positives.","wrong":"// wrong: core camelcase flags optional chaining like foo?.a_b","symbol":"babel/camelcase","correct":"// In .eslintrc: \"rules\": { \"babel/camelcase\": \"error\" }"},{"note":"Allows this inside class properties.","wrong":"// wrong: core no-invalid-this errors on class properties using this","symbol":"babel/no-invalid-this","correct":"// In .eslintrc: \"rules\": { \"babel/no-invalid-this\": \"error\" }"},{"note":"Handles for-await and class properties; autofixable.","wrong":"// wrong: core semi fails on for await and class properties","symbol":"babel/semi","correct":"// In .eslintrc: \"rules\": { \"babel/semi\": \"error\" }"},{"note":"Supports export x from and export * as x from; autofixable.","wrong":"// wrong: core object-curly-spacing complains on export x from 'mod'","symbol":"babel/object-curly-spacing","correct":"// In .eslintrc: \"rules\": { \"babel/object-curly-spacing\": \"error\" }"}],"quickstart":{"code":"npm install eslint-plugin-babel --save-dev\n\n// .eslintrc.json\n{\n  \"plugins\": [\"babel\"],\n  \"rules\": {\n    \"babel/new-cap\": \"error\",\n    \"babel/camelcase\": \"error\",\n    \"babel/no-invalid-this\": \"error\",\n    \"babel/semi\": \"error\"\n  }\n}\n\n// Disable the original rules in your config if they conflict:\n{\n  \"rules\": {\n    \"new-cap\": \"off\",\n    \"camelcase\": \"off\",\n    \"no-invalid-this\": \"off\",\n    \"semi\": \"off\"\n  }\n}","lang":"json","description":"Shows installation, plugin setup, and rule configuration. Remember to disable the core versions of replaced rules."},"warnings":[{"fix":"Upgrade ESLint to >=4.0.0 and Node to >=4. Ensure eslint-rule-composer is installed.","message":"v5.0.0 dropped support for ESLint <4.0.0 and Node <4. Use eslint-rule-composer for rules.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Use corresponding core ESLint rules (or eslint-plugin-flowtype for flow-object-type) as listed in the README.","message":"Rules babel/generator-star-spacing, babel/object-shorthand, babel/arrow-parens, babel/func-params-comma-dangle, babel/array-bracket-spacing, babel/flow-object-type, and babel/no-await-in-loop are deprecated.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Use core ESLint rule no-await-in-loop (supported since ESLint 3.12.0).","message":"babel/no-await-in-loop was deprecated in v4.1.1 and removed in later versions.","severity":"deprecated","affected_versions":">=4.1.1"},{"fix":"Install eslint-plugin-flowtype and use flowtype/object-type-delimiter.","message":"babel/flow-object-type was deprecated in v4.0.0. Use eslint-plugin-flowtype's object-type-delimiter rule instead.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Disable the core rule (e.g., 'new-cap': 'off') when using the babel version.","message":"Do not enable both the core rule and the babel rule for the same rule name — they will conflict.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Add '\"plugins\": [\"babel\"]' to your .eslintrc.","message":"The plugin does not automatically apply to all files; you must add the babel plugin to your ESLint config.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'4':52 '4.0.0':49 '5.3.1':40 'activ':98 'autofix':102 'avoid':67 'awar':64 'babel':4,11,22,63,109,116 'babel-awar':62 'babel-eslint':10,115 'bigint':34 'built':58 'built-in':57 'chain':29 'class':30 'companion':8 'compos':93 'composit':96 'core':17 'decor':27 'deprec':76 'eslint':2,6,12,18,48,81,85,91,110,113,117 'eslint-plugin':112 'eslint-plugin-babel':1 'eslint-plugin-flowtyp':84 'eslint-rule-compos':90 'eslintplugin':111 'experiment':23 'express':33 'fals':68 'favor':78 'featur':24 'flowtyp':87 'fragment':37 'handl':21 'implement':16 'javascript':108 'jsx':36 'latest':43 'maintain':99 'mark':106 'nativ':80 'node':51 'older':72 'option':28 'plugin':3,7,54,86,114 'positives/negatives':69 'problemat':56 'properti':31 're':15 're-impl':14 'releas':45 'replac':55 'requir':47 'rule':19,60,73,82,92,95,105 'sever':71 'stabl':44 'support':101 'syntax':38 'use':89 'version':39,65","created_at":"2026-04-25T11:19:09.159948+00:00","updated_at":"2026-04-25T11:19:09.159948+00:00","problems":[{"fix":"Run 'npm install eslint-plugin-babel --save-dev'","cause":"eslint-plugin-babel is not installed as a dev dependency.","error":"Error: Failed to load plugin 'babel': Cannot find module 'eslint-plugin-babel'"},{"fix":"Add '\"plugins\": [\"babel\"]' to your .eslintrc.","cause":"The 'babel' plugin is not listed in the 'plugins' section of your ESLint config.","error":"Error: ESLint configuration error: Unknown rule \"babel/new-cap\""},{"fix":"Install babel-eslint: 'npm install babel-eslint --save-dev' and set \"parser\": \"babel-eslint\" in your ESLint config.","cause":"The plugin expects babel-eslint or @babel/eslint-parser as a parser, but it's missing.","error":"Error: Cannot find module '@babel/eslint-parser' (or babel-eslint)"},{"fix":"Replace 'babel/flow-object-type' with 'flowtype/object-type-delimiter' and install eslint-plugin-flowtype.","cause":"The rule was deprecated in favor of eslint-plugin-flowtype's object-type-delimiter.","error":"Warning: Rule 'babel/flow-object-type' is deprecated"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/babel/eslint-plugin-babel","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-plugin-babel","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}