
Security News
pnpm 10.16 Adds New Setting for Delayed Dependency Updates
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
@babel/eslint-parser
Advanced tools
ESLint parser that allows for linting of experimental syntax transformed by Babel
The @babel/eslint-parser package is an ESLint parser that allows you to lint all valid Babel code with ESLint. It is designed to be used with ESLint and Babel, enabling developers to use ESLint on code that contains Babel-specific syntax. The parser is compatible with the latest JavaScript features and experimental syntax, allowing developers to write modern JavaScript without worrying about linting issues.
Parsing Babel Code
This feature allows you to parse Babel code with ESLint. The code sample shows how to configure ESLint to use @babel/eslint-parser in an ESLint configuration file.
module.exports = {
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: ['@babel/preset-env']
}
}
};
Using with ESLint and Babel
This feature integrates ESLint with Babel, allowing you to apply ESLint rules to Babel code. The code sample provides an example of an ESLint configuration that uses @babel/eslint-parser and specifies some ESLint rules.
module.exports = {
extends: ['eslint:recommended'],
parser: '@babel/eslint-parser',
env: {
browser: true,
es6: true
},
rules: {
'no-unused-vars': 'warn',
'no-console': 'off'
}
};
Espree is the default parser for ESLint and is built on top of Acorn. It is used to parse ECMAScript 2015+ code. While it supports many modern JavaScript features, it does not have the same level of experimental syntax support as @babel/eslint-parser.
This is an ESLint plugin that pairs with typescript-eslint/parser. It contains a set of ESLint rules that are specific to TypeScript code. It is similar to @babel/eslint-parser in that it extends ESLint's capabilities to additional syntax, but it is focused on TypeScript rather than Babel.
allows you to lint all valid Babel code with the fantastic ESLint
See our website @babel/eslint-parser for more information or the issues associated with this package.
Using npm:
npm install --save-dev @babel/eslint-parser
or using yarn:
yarn add @babel/eslint-parser --dev
FAQs
ESLint parser that allows for linting of experimental syntax transformed by Babel
The npm package @babel/eslint-parser receives a total of 7,090,346 weekly downloads. As such, @babel/eslint-parser popularity was classified as popular.
We found that @babel/eslint-parser 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
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.