Gathering detailed insights and metrics for babel-eslint
Gathering detailed insights and metrics for babel-eslint
Gathering detailed insights and metrics for babel-eslint
Gathering detailed insights and metrics for babel-eslint
@babel/eslint-parser
ESLint parser that allows for linting of experimental syntax transformed by Babel
eslint-plugin-babel
an eslint rule plugin companion to babel-eslint
@babel/eslint-plugin
Companion rules for @babel/eslint-parser
@nicolo-ribaudo/eslint-scope-5-internals
Proxy package exposing internals of eslint-scope@5 for @babel/eslint-parser
🗼 A wrapper for Babel's parser used for ESLint (renamed to @babel/eslint-parser)
npm install babel-eslint
Typescript
Module System
Min. Node Version
Node Version
NPM Version
80.1
Supply Chain
93.4
Quality
81.9
Maintenance
100
Vulnerability
98.6
License
JavaScript (99.86%)
Makefile (0.14%)
Total Downloads
1,858,516,862
Last Day
467,981
Last Week
3,493,537
Last Month
16,807,090
Last Year
209,628,412
2,966 Stars
563 Commits
209 Forks
53 Watching
13 Branches
89 Contributors
Latest Version
10.1.0
Package Id
babel-eslint@10.1.0
Size
9.20 kB
NPM Version
6.13.7
Node Version
13.8.0
Publised On
26 Feb 2020
Cumulative downloads
Total Downloads
Last day
-28.3%
467,981
Compared to previous day
Last week
-8.9%
3,493,537
Compared to previous week
Last month
-12%
16,807,090
Compared to previous month
Last year
-18%
209,628,412
Compared to previous year
babel-eslint allows you to lint ALL valid Babel code with the fantastic ESLint.
You only need to use babel-eslint if you are using types (Flow) or experimental features not supported in ESLint itself yet. Otherwise try the default parser (you don't have to use it just because you are using Babel).
If there is an issue, first check if it can be reproduced with the regular parser or with the latest versions of
eslint
andbabel-eslint
!
For questions and support please visit the #discussion
babel slack channel (sign up here) or eslint gitter!
Note that the
ecmaFeatures
config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. Examples areglobalReturn
andmodules
).
Flow:
Check out eslint-plugin-flowtype: An
eslint
plugin that makes flow type annotations global variables and marks declarations as used. Solves the problem of false positives withno-undef
andno-unused-vars
.
no-undef
for global flow types: ReactElement
, ReactClass
#130
.eslintrc
or define types and import them import type ReactElement from './types'
no-unused-vars/no-undef
with Flow declarations (declare module A {}
) #132Modules/strict mode
no-unused-vars: [2, {vars: local}]
#136Please check out eslint-plugin-react for React/JSX issues
no-unused-vars
with jsxPlease check out eslint-plugin-babel for other issues
ESLint allows custom parsers. This is great but some of the syntax nodes that Babel supports aren't supported by ESLint. When using this plugin, ESLint is monkeypatched and your code is transformed into code that ESLint can understand. All location info such as line numbers, columns is also retained so you can track down errors with ease.
Basically babel-eslint
exports an index.js
that a linter can use.
It just needs to export a parse
method that takes in a string of code and outputs an AST.
ESLint | babel-eslint |
---|---|
4.x | >= 6.x |
3.x | >= 6.x |
2.x | >= 6.x |
1.x | >= 5.x |
Ensure that you have substituted the correct version lock for eslint
and babel-eslint
into this command:
1$ npm install eslint@4.x babel-eslint@8 --save-dev 2# or 3$ yarn add eslint@4.x babel-eslint@8 -D
.eslintrc
1{ 2 "parser": "babel-eslint", 3 "rules": { 4 "strict": 0 5 } 6}
Check out the ESLint docs for all possible rules.
sourceType
can be set to 'module'
(default) or 'script'
if your code isn't using ECMAScript modules.allowImportExportEverywhere
(default false
) can be set to true
to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. Otherwise import and export declarations can only appear at a program's top level.codeFrame
(default true
) can be set to false
to disable the code frame in the reporter. This is useful since some eslint formatters don't play well with it..eslintrc
1{ 2 "parser": "babel-eslint", 3 "parserOptions": { 4 "sourceType": "module", 5 "allowImportExportEverywhere": false, 6 "codeFrame": true 7 } 8}
1$ eslint your-files-here
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 18/22 approved changesets -- score normalized to 8
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
21 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More