Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
@babel/eslint-plugin
Advanced tools
Changelog
v7.23.5 (2023-11-29)
babel-plugin-proposal-decorators
babel-helpers
, babel-plugin-proposal-decorators
babel-traverse
, babel-types
babel-plugin-transform-classes
babel-generator
babel-helpers
babel-helper-create-class-features-plugin
, babel-plugin-transform-class-properties
, babel-plugin-transform-typescript
super()
(@nicolo-ribaudo)babel-generator
, babel-plugin-transform-modules-commonjs
, babel-plugin-transform-parameters
, babel-plugin-transform-typescript
, babel-traverse
babel-eslint-plugin
@babel/eslint-plugin/no-undef
to fix no-undef
with accessor props (@nicolo-ribaudo)babel-helpers
decorator
helper size (@liuxingbaoyu)Readme
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
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"
}
}
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 (🛠)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.
FAQs
Companion rules for @babel/eslint-parser
The npm package @babel/eslint-plugin receives a total of 345,527 weekly downloads. As such, @babel/eslint-plugin popularity was classified as popular.
We found that @babel/eslint-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.