Skip to content

Commit

Permalink
@babel/eslint-plugin: remove deprecated rules (#10975)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo authored and nicolo-ribaudo committed Jan 10, 2020
1 parent 3dcb8ca commit 4cb2148
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 1,043 deletions.
24 changes: 4 additions & 20 deletions eslint/babel-eslint-plugin/README.md
Expand Up @@ -26,14 +26,12 @@ original ones as well!).
```json
{
"rules": {
"babel/new-cap": "error",
"babel/camelcase": "error",
"babel/new-cap": "error",
"babel/no-invalid-this": "error",
"babel/no-unused-expressions": "error",
"babel/object-curly-spacing": "error",
"babel/quotes": "error",
"babel/semi": "error",
"babel/no-unused-expressions": "error",
"babel/valid-typeof": "error"
}
}
```
Expand All @@ -43,23 +41,9 @@ Each rule corresponds to a core `eslint` rule, and has the same options.

🛠: means it's autofixable with `--fix`.

- `babel/new-cap`: Ignores capitalized decorators (`@Decorator`)
- `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/quotes`: doesn't complain about JSX fragment shorthand syntax (`<>foo</>;`)
- `babel/semi`: doesn't fail when using `for await (let something of {})`. Includes class properties (🛠)
- `babel/no-unused-expressions`: doesn't fail when using `do` expressions or [optional chaining](https://github.com/tc39/proposal-optional-chaining) (`a?.b()`).
- `babel/valid-typeof`: doesn't complain when used with [BigInt](https://github.com/tc39/proposal-bigint) (`typeof BigInt(9007199254740991) === 'bigint'`).

#### Deprecated

| Rule | Notes |
|:---------------------------------|:-----------------------------------|
| `babel/generator-star-spacing` | Use [`generator-star-spacing`](http://eslint.org/docs/rules/generator-star-spacing) since eslint@3.6.0 |
| `babel/object-shorthand` | Use [`object-shorthand`](http://eslint.org/docs/rules/object-shorthand) since eslint@0.20.0 |
| `babel/arrow-parens` | Use [`arrow-parens`](http://eslint.org/docs/rules/arrow-parens) since eslint@3.10.0 |
| `babel/func-params-comma-dangle` | Use [`comma-dangle`](http://eslint.org/docs/rules/comma-dangle) since eslint@3.8.0 |
| `babel/array-bracket-spacing` | Use [`array-bracket-spacing`](http://eslint.org/docs/rules/array-bracket-spacing) since eslint@3.9.0 |
| `babel/flow-object-type` | Use [`flowtype/object-type-delimiter`](https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter) since eslint-plugin-flowtype@2.23.0 |
| `babel/no-await-in-loop` | Use [`no-await-in-loop`](http://eslint.org/docs/rules/no-await-in-loop) since eslint@3.12.0 |
29 changes: 1 addition & 28 deletions eslint/babel-eslint-plugin/src/index.js
@@ -1,52 +1,25 @@
import arrayBracketSpacing from "./rules/array-bracket-spacing";
import arrowParens from "./rules/arrow-parens";
import flowObjectType from "./rules/flow-object-type";
import funcParamsCommaDangle from "./rules/func-params-comma-dangle";
import generatorStarSpacing from "./rules/generator-star-spacing";
import newCap from "./rules/new-cap";
import camelcase from "./rules/camelcase";
import noAwaitInLoop from "./rules/no-await-in-loop";
import noInvalidThis from "./rules/no-invalid-this";
import noUnusedExpressions from "./rules/no-unused-expressions";
import objectCurlySpacing from "./rules/object-curly-spacing";
import objectShorthand from "./rules/object-shorthand";
import quotes from "./rules/quotes";
import semi from "./rules/semi";
import validTypeof from "./rules/valid-typeof";

module.exports = {
rules: {
"array-bracket-spacing": arrayBracketSpacing,
"arrow-parens": arrowParens,
"flow-object-type": flowObjectType,
"func-params-comma-dangle": funcParamsCommaDangle,
"generator-star-spacing": generatorStarSpacing,
"new-cap": newCap,
camelcase,
"no-await-in-loop": noAwaitInLoop,
"new-cap": newCap,
"no-invalid-this": noInvalidThis,
"no-unused-expressions": noUnusedExpressions,
"object-curly-spacing": objectCurlySpacing,
"object-shorthand": objectShorthand,
quotes,
semi,
"valid-typeof": validTypeof,
},
rulesConfig: {
"array-bracket-spacing": "off",
"arrow-parens": "off",
camelcase: "off",
"flow-object-type": "off",
"func-params-comma-dangle": "off",
"generator-star-spacing": "off",
"new-cap": "off",
"no-await-in-loop": "off",
"no-invalid-this": "off",
"no-unused-expressions": "off",
"object-curly-spacing": "off",
"object-shorthand": "off",
quotes: "off",
semi: "off",
"valid-typeof": "off",
},
};
45 changes: 0 additions & 45 deletions eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js

This file was deleted.

30 changes: 0 additions & 30 deletions eslint/babel-eslint-plugin/src/rules/arrow-parens.js

This file was deleted.

33 changes: 0 additions & 33 deletions eslint/babel-eslint-plugin/src/rules/flow-object-type.js

This file was deleted.

30 changes: 0 additions & 30 deletions eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js

This file was deleted.

42 changes: 0 additions & 42 deletions eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js

This file was deleted.

26 changes: 0 additions & 26 deletions eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js

This file was deleted.

30 changes: 0 additions & 30 deletions eslint/babel-eslint-plugin/src/rules/object-shorthand.js

This file was deleted.

14 changes: 0 additions & 14 deletions eslint/babel-eslint-plugin/src/rules/quotes.js

This file was deleted.

8 changes: 0 additions & 8 deletions eslint/babel-eslint-plugin/src/rules/valid-typeof.js

This file was deleted.

0 comments on commit 4cb2148

Please sign in to comment.