Add explicit loose configuration for babel plugins (#14048)

* Add explicit loose configuration for babel private-property plugin

Squelch this warning that happens a few dozen times during CI by
following the instructions:

Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-methods.

The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding

	["@babel/plugin-proposal-private-property-in-object", { "loose": true }]

to the "plugins" section of your Babel config.

* Use spaces instead of tabs

This won't affect the test.

* Make all the other "implied loose" options loose, too.

This now squelches the warnings, and webpacker can compile without failing.

* Collect common option "loose: true" to preset env

Rather than 3 overrides to bring these inline, move to the shared options.

* Revert "Collect common option "loose: true" to preset env"

This reverts commit ca3d09ba6a47e03dbfb5f6108fcbc7f19b5a457b.
This commit is contained in:
Daniel Uber 2021-06-23 13:57:51 -05:00 committed by GitHub
parent 4d0b9c8ebf
commit 69a03c8b07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,6 +42,7 @@ module.exports = function (api) {
'@babel/plugin-proposal-class-properties',
{
spec: true,
loose: true,
},
],
[
@ -50,6 +51,18 @@ module.exports = function (api) {
useBuiltIns: true,
},
],
[
'@babel/plugin-proposal-private-property-in-object',
{
loose: true,
}
],
[
'@babel/plugin-proposal-private-methods',
{
loose: true,
}
],
[
'@babel/plugin-transform-react-jsx',
{