Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Feature: Enable syntax based on reading from .babelrc #573

@hzoo

Description

@hzoo

Ref #434 (subset of syntax), #523 (user plugins), #505 (Typescript)

plugins: [
"flow",
"jsx",
"estree",
"asyncFunctions",

Instead of having to:

  • add to the plugin list whenever there is a new syntax and release a new version
  • using a wildcard/star * option (found out that was a bad idea due to breaking changes between plugins like decorators/decorators2 so wouldn't be able to easily resolve that)
  • expose a user config whitelist

We should be able to just read from a user's Babel config. @babel/core should expose a way for another tool to get relevant information from a user's config file (like return the list of syntax plugins used). babel-eslint could try to read that and just populate the parser options and we can remove the defaults. I think it's safe to assume if you are using babel-eslint you are using babel, and should have a config (can wrap in try/catch or fallback to default list)?

  • Less config (re-using config)
  • Enable subset of features
  • We should be able to remove all deps and just do a peerDep on @babel/core maybe? Then it would use the version of babel in your project rather than it's own dep. And maybe the same for the eslint deps?

"@babel/code-frame": "7.0.0-beta.36",
"@babel/traverse": "7.0.0-beta.36",
"@babel/types": "7.0.0-beta.36",
"babylon": "7.0.0-beta.36",

edit: I believe we are only using @babel/types to get the the VISITOR_KEYS, and traverse to do a fast transform of the AST

Thoughts? cc @ljharb @kaicataldo @loganfsmyth @azz @danez @zertosh

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions