-
-
Notifications
You must be signed in to change notification settings - Fork 207
Feature: Enable syntax based on reading from .babelrc #573
Description
Ref #434 (subset of syntax), #523 (user plugins), #505 (Typescript)
Lines 18 to 22 in bf27f60
| 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/coremaybe? 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?
Lines 14 to 17 in bf27f60
| "@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