7.27.1 • Published 5 months ago

@babel/eslint-plugin v7.27.1

Weekly downloads
64,638
License
MIT
Repository
github
Last release
5 months ago

@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. @babel/eslint-plugin re-implements problematic rules so they do not give false positives or negatives.

Requires Node 10.13 or greater

Install

npm install @babel/eslint-plugin --save-dev

Load the plugin in your .eslintrc.json file:

{
  "plugins": ["@babel"]
}

Finally enable all the rules you would like to use (remember to disable the original ones as well!).

{
  "rules": {
    "@babel/new-cap": "error",
    "@babel/no-invalid-this": "error",
    "@babel/no-undef": "error",
    "@babel/no-unused-expressions": "error",
    "@babel/object-curly-spacing": "error",
    "@babel/semi": "error"
  }
}

Rules

Each rule corresponds to a core eslint rule and has the same options.

šŸ› : means it's autofixable with --fix.

  • @babel/new-cap: handles decorators (@Decorator)
  • @babel/no-invalid-this: handles class fields and private class methods (class A { a = this.b; })
  • @babel/no-undef: handles class accessor properties (class A { accessor x = 2 })
  • @babel/no-unused-expressions: handles do expressions
  • @babel/object-curly-spacing: handles export * as x from "mod"; (šŸ› )
  • @babel/semi: Handles class properties (šŸ› )

TypeScript

While @babel/eslint-parser can parse TypeScript, we don't currently support linting TypeScript using the rules in @babel/eslint-plugin. This is because the TypeScript community has centered around @typescript-eslint and we want to avoid duplicate work. Additionally, since @typescript-eslint uses TypeScript under the hood, its rules can be made type-aware, which is something Babel doesn't have the ability to do.

corvus-sst-cli@spothero/eslint-config@benepass/eslint-config-benepass@andrmoel/eslint-config-defaulteslint-config-mg@thtliife/eslint-config@dr.pogodin/native-tabs-app-common@rightinyourwheelhouse/eslint-config@everything-registry/sub-chunk-108eslint-config-universe-xyzwgshopxcraft-dev-ruleswhouse-eslint-configwglintxing-form-enginevite-configinker-configgunlint@wide-web/eslint-plugin@web-configs/eslint-plugin@vta/eslint-config-babel@we-make-websites/eslint-config@twipped/eslint-config@umijs/fabric@threads/tsconfig@typedigital/eslint-config@timeedit/eslint-config-construct@tinkoff/eslint-config@trinitymirrordigital/eslint-config-et@uspect/eslint-config@v-libs/eslint-plugins@viralganatra/app-scripts@xh/eslint-config@ygyg/eslint-config@zenloopgmbh/eslint-config-babelappcd-gulp@hannohealth/eslint-config@haojian-app/eslint-config@haowang_jia/utils@hankliu/fabric@halodong/eslint-config-react@hallarhq/eslint-config@e1011/eslint-config@earlorg/eslint-config@easynm/eslint-config@eds-open/eslint-config-bundle@codit/eslint-config@comandeer/eslint-config@colussi/eslint-configeslint-config-yialopkg-web-browseryma-cli-lintyma-lintyicode-cliyicode-cli0020yipack-cliwccode-cliwebpack-cli-util@kununu/eslint-config@leearhub/eslint-config@lewisl9029/project-boilerplate@lepui/eslint-config@lepui/lep-eslint-config@lukas.skamarakas/eslint-plugin@nestgenesis/eslint-config@nazarkulyk/eslint-config-esnext@nekogaming/eslint-config-esnext@podlipny/eslint-rulesreach-et-eslint-configrollup-scriptsreact-native-zendriveperfectlintpropreclient-pluginclient-layoutclient-imclient-containerclient-sidebarcore-mock-apiaui-designbaidu-acu-react-tools@sprylab/eslint-config@stae/linters@superkoders/eslint-config@strukt-js/eslint-config-strukt@taiga-ui/eslint-plugineslint-config-rakeshshresthaeslint-config-reacheslint-config-reach-dragonflyeslint-config-reach-eteslint-plugin-elteslint-config-krosseslint-config-peerigoneslint-config-nordcomeslint-config-nsteslint-config-zombieeslint-config-twippedeslint-config-feeslint-config-as3mbuseslint-config-ash-nazg
7.27.1

6 months ago

7.27.0

7 months ago

7.26.10

8 months ago

8.0.0-beta.0

5 months ago

8.0.0-alpha.14

11 months ago

8.0.0-alpha.15

10 months ago

8.0.0-alpha.16

9 months ago

8.0.0-alpha.17

8 months ago

8.0.0-alpha.13

1 year ago

7.25.9

1 year ago

7.25.7

1 year ago

8.0.0-alpha.9

1 year ago

7.25.1

1 year ago

8.0.0-alpha.10

1 year ago

7.24.6

1 year ago

8.0.0-alpha.11

1 year ago

8.0.0-alpha.12

1 year ago

7.24.7

1 year ago

7.24.5

2 years ago

7.24.5-pre.1

2 years ago

8.0.0-alpha.8

2 years ago

8.0.0-alpha.7

2 years ago

8.0.0-alpha.6

2 years ago

8.0.0-alpha.5

2 years ago

7.23.5

2 years ago

8.0.0-alpha.0

2 years ago

8.0.0-alpha.3

2 years ago

8.0.0-alpha.4

2 years ago

8.0.0-alpha.1

2 years ago

8.0.0-alpha.2

2 years ago

7.22.10

2 years ago

7.22.5

2 years ago

7.21.4-esm

3 years ago

7.21.4-esm.2

3 years ago

7.21.4-esm.3

3 years ago

7.21.4-esm.1

3 years ago

7.21.4-esm.4

3 years ago

7.19.1

3 years ago

7.18.10

3 years ago

7.17.7

4 years ago

7.16.5

4 years ago

7.14.5

4 years ago

7.13.16

5 years ago

7.13.15

5 years ago

7.13.10

5 years ago

7.13.0

5 years ago

7.12.13

5 years ago

7.12.1

5 years ago

7.11.5

5 years ago

7.11.3

5 years ago

7.11.0

5 years ago