7.25.9 ā€¢ Published 5 months ago

@babel/eslint-plugin v7.25.9

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-enginerollup-scriptsvite-configeslint-config-yialoinker-configgunlintproprepkg-web-browserperfectlintreact-native-zendrivereach-et-eslint-config@aoeu/eslint-config@anansi/eslint-plugin@ast-tools/eslint-config@alicd/eslint-config-cone@alola-react-sdk/eslint-config@bamdadsabbagh/eslint-config@axway/gulp-tasks@bfun/solution-webpack4-standard@bigbite/build-tools@brixtol/eslint-config-javascript@budarin/spa-react-app-config@breeffy/eslint-config-react-native@carlosvillu/lint@carlosvillu/lint-classicmanager@byintera/eslint-config@bszx/standard@chipzhang/boilerplate@cldcvr/eslint-config-ts@cldcvr/eslint-config-vue@chimericdream/eslint-config-babel@19h47/slider@1stg/eslint-config@1pedro/eslint-config@codit/eslint-config@bowencool/eslint-config@dcm/eslint-config@deepjs/lint@dh-scripts/run@digest/eslint-config-babel@dhruv-m-patel/eslint-config-baseyma-cli-lintyma-lintyicode-cliyicode-cli0020yipack-cliwccode-cliwebpack-cli-util@fastcms/eslint-config@hannohealth/eslint-config@hallarhq/eslint-config@hankliu/fabric@haojian-app/eslint-config@haowang_jia/utils@halodong/eslint-config-react@igorjs/eslint-config-strict-js@flecks/build@floydspace/eslint-config@freaktechnik/eslint-config-babel@futagoza/eslint-config-javascript@gilbarbara/eslint-config@gln-libs/eslint-plugins@kununu/eslint-config@leearhub/eslint-config@lewisl9029/project-boilerplate@lepui/eslint-config@lepui/lep-eslint-config@isfawwaz/eslint-config-babel@lukas.skamarakas/eslint-plugin@magijs/lint@mewjs/cli@mewjs/eslint-plugin@moxy/eslint-config-babel@mapstore/eslint-config-mapstore@nestgenesis/eslint-config@nazarkulyk/eslint-config-esnext@nekogaming/eslint-config-esnext@enfusion-ui/eslint-config@exercism/eslint-config-javascript@earlorg/eslint-config@e1011/eslint-config@easynm/eslint-config@eds-open/eslint-config-bundle@mikey-pro/eslint-config@mikey-pro/eslint-config-mkt@mikey-pro/eslint-config-preact
8.0.0-alpha.13

5 months ago

7.25.9

5 months ago

7.25.7

6 months ago

8.0.0-alpha.9

10 months ago

7.25.1

8 months ago

8.0.0-alpha.10

10 months ago

7.24.6

10 months ago

8.0.0-alpha.11

10 months ago

8.0.0-alpha.12

8 months ago

7.24.7

10 months ago

7.24.5

11 months ago

7.24.5-pre.1

12 months ago

8.0.0-alpha.8

12 months ago

8.0.0-alpha.7

1 year ago

8.0.0-alpha.6

1 year ago

8.0.0-alpha.5

1 year ago

7.23.5

1 year ago

8.0.0-alpha.0

2 years ago

8.0.0-alpha.3

2 years ago

8.0.0-alpha.4

1 year 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

2 years ago

7.21.4-esm.2

2 years ago

7.21.4-esm.3

2 years ago

7.21.4-esm.1

2 years ago

7.21.4-esm.4

2 years ago

7.19.1

3 years ago

7.18.10

3 years ago

7.17.7

3 years ago

7.16.5

3 years ago

7.14.5

4 years ago

7.13.16

4 years ago

7.13.15

4 years ago

7.13.10

4 years ago

7.13.0

4 years ago

7.12.13

4 years ago

7.12.1

4 years ago

7.11.5

5 years ago

7.11.3

5 years ago

7.11.0

5 years ago