diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 2d1e11c45860..5577c01344c0 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -1,7 +1,7 @@ # @babel/eslint-plugin Companion rules for `@babel/eslint-parser`. `@babel/eslint-parser` does a great job at adapting `eslint` -for use with Babel, but it can't change the built in rules to support experimental features. +for use with Babel, but it can't change the built-in rules to support experimental features. `@babel/eslint-plugin` re-implements problematic rules so they do not give false positives or negatives. > Requires Node 10.9 or greater @@ -26,7 +26,6 @@ original ones as well!). ```json { "rules": { - "babel/camelcase": "error", "babel/new-cap": "error", "babel/no-invalid-this": "error", "babel/no-unused-expressions": "error", @@ -37,13 +36,12 @@ original ones as well!). ``` ### Rules -Each rule corresponds to a core `eslint` rule, and has the same options. +Each rule corresponds to a core `eslint` rule and has the same options. 🛠: means it's autofixable with `--fix`. -- `babel/camelcase: doesn't complain about optional chaining (`var foo = bar?.a_b;`) -- `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) -- `babel/no-invalid-this`: doesn't fail when inside class properties (`class A { a = this.b; }`) -- `babel/no-unused-expressions`: doesn't fail when using `do` expressions or [optional chaining](https://github.com/tc39/proposal-optional-chaining) (`a?.b()`). -- `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠) -- `babel/semi`: doesn't fail when using `for await (let something of {})`. Includes class properties (🛠) +- `babel/new-cap`: handles decorators (`@Decorator`) +- `babel/no-invalid-this`: handles class fields and private class methods (`class A { a = this.b; }`) +- `babel/no-unused-expressions`: handles `do` expressions +- `babel/object-curly-spacing`: handles `export * as x from "mod";` (🛠) +- `babel/semi`: Handles class properties (🛠) diff --git a/eslint/babel-eslint-plugin/src/index.js b/eslint/babel-eslint-plugin/src/index.js index 8b8c0fbf37d7..96fd40caf70e 100644 --- a/eslint/babel-eslint-plugin/src/index.js +++ b/eslint/babel-eslint-plugin/src/index.js @@ -1,5 +1,4 @@ import newCap from "./rules/new-cap"; -import camelcase from "./rules/camelcase"; import noInvalidThis from "./rules/no-invalid-this"; import noUnusedExpressions from "./rules/no-unused-expressions"; import objectCurlySpacing from "./rules/object-curly-spacing"; @@ -7,7 +6,6 @@ import semi from "./rules/semi"; module.exports = { rules: { - camelcase, "new-cap": newCap, "no-invalid-this": noInvalidThis, "no-unused-expressions": noUnusedExpressions, @@ -15,7 +13,6 @@ module.exports = { semi, }, rulesConfig: { - camelcase: "off", "new-cap": "off", "no-invalid-this": "off", "no-unused-expressions": "off",