New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom parserOpts for babel parser in @babel/eslint-parser #11423
Conversation
); | ||
|
||
normalizedParserOptions.plugins = ["estree", ...parserPlugins]; | ||
if (options.allowImportExportEverywhere !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if options.allowImportExportEverywhere
exists, it'll use that over parserOpts. allowImportExportEverywhere
to prevent breaking changes.
parserOpts, | ||
); | ||
|
||
normalizedParserOptions.plugins = ["estree", ...parserPlugins]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the "estree"
plugin is necessary for the eslint parser here, so I figured we shouldn't override it.
@vikr01 We might want to do #11334 (comment) instead |
Somewhat related, but for those who are using a Babel config, we could always support (And yeah, I guess for the whole "passing config programmatically" story, we should roll with #11334 (comment)) |
@existentialism Agree — I think enabling the |
@nicolo-ribaudo That looks to be for babel config plugins, this is for the syntax plugins. Don’t the two work differently, or am I mistaken? |
@vikr01 My proposal was to allow passing a full Babel config, so you will also be able to pass |
The README for
@babel/eslint-parser
states:However, this hasn't exactly been true, because you can't override all of the babel parser's options. With this, there's now capability to use neat features like the
flowComments
plugin to lint flow comments just like flow typings.