Socket
Socket
Sign inDemoInstall

babel-eslint

Package Overview
Dependencies
137
Maintainers
2
Versions
135
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-eslint

**babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic [ESLint](https://github.com/eslint/eslint).


Version published
Weekly downloads
4M
decreased by-0.6%
Maintainers
2
Install size
12.4 MB
Created
Weekly downloads
 

Package description

What is babel-eslint?

The babel-eslint npm package is a parser that allows you to lint all valid Babel code with the ESLint linter. It is designed to be used with ESLint and Babel, providing compatibility between the two and allowing developers to use ESLint on code that contains Babel-specific syntax.

What are babel-eslint's main functionalities?

Parsing Babel Code for ESLint

This feature allows developers to configure ESLint to use babel-eslint as the parser, enabling ESLint to understand and lint code that includes Babel-specific syntax that is not yet supported by ESLint's default parser.

module.exports = { parser: 'babel-eslint', rules: { /* ESLint rules */ } };

Experimental Syntax Support

babel-eslint can parse experimental syntax such as class properties and async functions, which might not be supported by ESLint's default parser. This allows developers to use ESLint on projects that make use of the latest JavaScript features.

class MyClass { async myMethod() { /* ... */ } }

Custom Babel Configuration

babel-eslint allows developers to specify a custom Babel configuration file, ensuring that the parser understands the code in the same way Babel does when it transpiles the code.

{ "parserOptions": { "babelOptions": { "configFile": "path/to/your/babel.config.js" } } }

Other packages similar to babel-eslint

Readme

Source

babel-eslint Build Status

babel-eslint allows you to lint ALL valid Babel code with the fantastic ESLint.

NOTE: Please note that this is experimental and may have numerous bugs. It is however successfuly linting the babel core.

How does it work?

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.

Usage

Install

$ npm install -g eslint babel-eslint

Setup

.eslintrc

{
  "parser": "babel-eslint",
  "rules": {
    "strict": 0
  }
}

Check out the ESLint docs for all possible rules.

Run

$ eslint your-files-here

FAQs

Last updated on 21 May 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc