Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Jan 10, 2020
1 parent 4dcaf0e commit d89cf03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
16 changes: 7 additions & 9 deletions 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
Expand All @@ -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",
Expand All @@ -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 (馃洜)
3 changes: 0 additions & 3 deletions eslint/babel-eslint-plugin/src/index.js
@@ -1,21 +1,18 @@
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";
import semi from "./rules/semi";

module.exports = {
rules: {
camelcase,
"new-cap": newCap,
"no-invalid-this": noInvalidThis,
"no-unused-expressions": noUnusedExpressions,
"object-curly-spacing": objectCurlySpacing,
semi,
},
rulesConfig: {
camelcase: "off",
"new-cap": "off",
"no-invalid-this": "off",
"no-unused-expressions": "off",
Expand Down

0 comments on commit d89cf03

Please sign in to comment.