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
Invalid warning for not declaring 'corejs' option when using 'useBuiltIns': 'false' #11352
Comments
Hey @JMarkoski! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite." |
We should throw an error about |
Yeah, that's definitely way more reasonable to do. I spent hours digging what the problem could be, and rereading the docs about |
Also, there are many places where the same situation can happen, so I think it should be either done everywhere or nowhere at all. |
preset-env uses
It seems to me that it suffices to simply this into builtInsOpt === false since practically Can you submit a PR? Thank you! |
@JLHwung Yes, I will submit a PR. Also, the same thing should be done with
I will add a fix for that in the PR as well. |
Bug Report
Current Behavior
When using
@babel/preset-env
and settinguseBuiltIns: 'false'
and not declaring acorejs
option, the following warning occurs:First, I don't know if this should be considered a bug, because the problem occurs only when setting the
useBuiltIns
option to the string'false'
and notfalse
. But if you set it accidentaly to a string value I think It should behave the same as when setting it to aboolean
one.Expected behavior/code
The warning should not occur.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
babel.config.js
Environment
Possible Solution
Upon inspecting the
@babel/preset-env
source code, in the filenormalize-options.js
in the functionnormalizeCoreJSOption
the following check is usedif (useBuiltIns && corejs === undefined) {
Using a more thorough check for
useBuiltIns
will fix the warning.The text was updated successfully, but these errors were encountered: