7.23.5 ā€¢ Published 19 days ago

@babel/eslint-plugin v7.23.5

Weekly downloads
64,638
License
MIT
Repository
github
Last release
19 days 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.

@modern-js-app/eslint-config@redwoodjs/eslint-configcorvus-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-108yicode-cliyicode-cli0020yipack-cliyma-cli-lintyma-lintwccode-cliwgshopwglintwhouse-eslint-configwebpack-cli-utilvite-config@mittonface/cli@ollion/eslint-config-ts@ollion/eslint-config-vue@lepui/eslint-config@lepui/lep-eslint-config@mewjs/cli@mewjs/eslint-plugin@miirinjej/eslint-config@mikey-pro/eslint-config@mikey-pro/eslint-config-mkt@mikey-pro/eslint-config-preact@moxy/eslint-config-babel@orozot-dojo/eslint-plugin@osedea/eslint-configxing-form-engine@jwilsson/eslint-config@leearhub/eslint-config@mapstore/eslint-config-mapstore@nestgenesis/eslint-config@lukas.skamarakas/eslint-plugin@pulsanova/eslint-config-esnext@nuskin/eslint-config-mobile@rscollabs/eslint-config@samiroy/eslint-config@rw-alpha/core@quartr/eslint-config-react@quartr/eslint-config-react-typescript@s-ui/lint@rea-jet/devtools@runtimeerrorsmadeeasy/ctabutton@nekogaming/eslint-config-esnext@pengyin/eslint-config@pdq/eslint-plugin-pdq@nazarkulyk/eslint-config-esnext@podlipny/eslint-config@podlipny/eslint-rules@psoares/eslint-config@nuskin/mobile-eslint-config@nuwe/js-eslint-config@nostalgiaswag/eslint-plugin-lint@progressivestudio/eslint-plugin@portto/eslint-config-porttoeslint-config-aftteslint-config-bdeslint-config-jsx@uspect/eslint-configeslint-config-hardestyeslint-config-canonicaleslint-config-codfisheslint-config-colinrobertbrooks@vta/eslint-config-babel@we-make-websites/eslint-configeslint-config-twippedeslint-config-universe-xyzeslint-plugin-ticknovateeslint-sdk-bd@trinitymirrordigital/eslint-config-et@strukt-js/eslint-config-strukt@stae/linters@typedigital/eslint-config@superkoders/eslint-config@kununu/eslint-config@magijs/lint@lewisl9029/project-boilerplate@medanat/eslint-config-flow@medanat/eslint-config-react@shcherbin/eslint-config@shopify/eslint-plugin@tinkoff/eslint-config@timeedit/eslint-config-construct@threads/tsconfig@sopfe/lint@reskript/config-lint@simple-easy/eslint-config@umijs/fabriceslint-config-as3mbuseslint-config-modern-classiceslint-config-impact-market
7.24.5-pre.1

19 days ago

8.0.0-alpha.8

23 days ago

8.0.0-alpha.7

2 months ago

8.0.0-alpha.6

3 months ago

8.0.0-alpha.5

5 months ago

7.23.5

5 months ago

8.0.0-alpha.0

9 months ago

8.0.0-alpha.3

7 months ago

8.0.0-alpha.4

7 months ago

8.0.0-alpha.1

9 months ago

8.0.0-alpha.2

9 months ago

7.22.10

9 months ago

7.22.5

11 months ago

7.21.4-esm

1 year ago

7.21.4-esm.2

1 year ago

7.21.4-esm.3

1 year ago

7.21.4-esm.1

1 year ago

7.21.4-esm.4

1 year ago

7.19.1

2 years ago

7.18.10

2 years ago

7.17.7

2 years ago

7.16.5

2 years ago

7.14.5

3 years ago

7.13.16

3 years ago

7.13.15

3 years ago

7.13.10

3 years ago

7.13.0

3 years ago

7.12.13

3 years ago

7.12.1

4 years ago

7.11.5

4 years ago

7.11.3

4 years ago

7.11.0

4 years ago