-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest using
BABEL_SHOW_CONFIG_FOR
for config problems (#12428)
Co-authored-by: Babel Bot <30521560+liuxingbaoyu@users.noreply.github.com>
- Loading branch information
1 parent
d8dc333
commit 741939c
Showing
24 changed files
with
265 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...test/fixtures/loose-class-features-precedence/methods-loose-preset-not-loose-win/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class A { | ||
x = 2; | ||
|
||
#foo() {} | ||
} |
15 changes: 15 additions & 0 deletions
15
.../fixtures/loose-class-features-precedence/methods-loose-preset-not-loose-win/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"os": ["win32"], | ||
"validateLogs": true, | ||
"presets": [ | ||
[ | ||
"env", | ||
{ | ||
"targets": { "node": 10 }, | ||
"shippedProposals": true | ||
} | ||
] | ||
], | ||
"plugins": [["transform-private-methods", { "loose": true }]] | ||
} |
10 changes: 10 additions & 0 deletions
10
...est/fixtures/loose-class-features-precedence/methods-loose-preset-not-loose-win/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var _foo = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo"); | ||
class A { | ||
constructor() { | ||
Object.defineProperty(this, _foo, { | ||
value: _foo2 | ||
}); | ||
this.x = 2; | ||
} | ||
} | ||
function _foo2() {} |
18 changes: 18 additions & 0 deletions
18
...st/fixtures/loose-class-features-precedence/methods-loose-preset-not-loose-win/stderr.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-transform-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-transform-private-methods. | ||
The "loose" option must be the same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods and @babel/plugin-transform-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding | ||
["@babel/plugin-transform-private-property-in-object", { "loose": true }] | ||
to the "plugins" section of your Babel config. | ||
|
||
If you already set the same 'loose' mode for these plugins in your config, it's possible that they are enabled multiple times with different options. | ||
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded configuration: | ||
npx cross-env BABEL_SHOW_CONFIG_FOR=<CWD>/packages/babel-preset-env/test/fixtures/loose-class-features-precedence/methods-loose-preset-not-loose-win/input.js <your build command> | ||
See https://babeljs.io/docs/configuration#print-effective-configs for more info. | ||
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-transform-class-properties since the "loose" mode option was set to "true" for @babel/plugin-transform-private-property-in-object. | ||
The "loose" option must be the same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods and @babel/plugin-transform-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding | ||
["@babel/plugin-transform-class-properties", { "loose": true }] | ||
to the "plugins" section of your Babel config. | ||
|
||
If you already set the same 'loose' mode for these plugins in your config, it's possible that they are enabled multiple times with different options. | ||
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded configuration: | ||
npx cross-env BABEL_SHOW_CONFIG_FOR=<CWD>/packages/babel-preset-env/test/fixtures/loose-class-features-precedence/methods-loose-preset-not-loose-win/input.js <your build command> | ||
See https://babeljs.io/docs/configuration#print-effective-configs for more info. |
14 changes: 8 additions & 6 deletions
14
...test/fixtures/loose-class-features-precedence/methods-loose-preset-not-loose/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"os": ["darwin", "linux"], | ||
"validateLogs": true, | ||
"presets": [ | ||
["env", { | ||
"targets": { "node": 10 } | ||
}] | ||
[ | ||
"env", | ||
{ | ||
"targets": { "node": 10 } | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
["transform-private-methods", { "loose": true }] | ||
] | ||
"plugins": [["transform-private-methods", { "loose": true }]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...t/fixtures/loose-class-features-precedence/properties-loose-preset-not-loose-win/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class A { | ||
x = 2; | ||
|
||
#foo() {} | ||
} |
15 changes: 15 additions & 0 deletions
15
...xtures/loose-class-features-precedence/properties-loose-preset-not-loose-win/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"os": ["win32"], | ||
"validateLogs": true, | ||
"presets": [ | ||
[ | ||
"env", | ||
{ | ||
"targets": { "node": 10 }, | ||
"shippedProposals": true | ||
} | ||
] | ||
], | ||
"plugins": [["transform-class-properties", { "loose": true }]] | ||
} |
10 changes: 10 additions & 0 deletions
10
.../fixtures/loose-class-features-precedence/properties-loose-preset-not-loose-win/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var _foo = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo"); | ||
class A { | ||
constructor() { | ||
Object.defineProperty(this, _foo, { | ||
value: _foo2 | ||
}); | ||
this.x = 2; | ||
} | ||
} | ||
function _foo2() {} |
18 changes: 18 additions & 0 deletions
18
...fixtures/loose-class-features-precedence/properties-loose-preset-not-loose-win/stderr.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-transform-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-transform-class-properties. | ||
The "loose" option must be the same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods and @babel/plugin-transform-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding | ||
["@babel/plugin-transform-private-property-in-object", { "loose": true }] | ||
to the "plugins" section of your Babel config. | ||
|
||
If you already set the same 'loose' mode for these plugins in your config, it's possible that they are enabled multiple times with different options. | ||
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded configuration: | ||
npx cross-env BABEL_SHOW_CONFIG_FOR=<CWD>/packages/babel-preset-env/test/fixtures/loose-class-features-precedence/properties-loose-preset-not-loose-win/input.js <your build command> | ||
See https://babeljs.io/docs/configuration#print-effective-configs for more info. | ||
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-transform-private-methods since the "loose" mode option was set to "true" for @babel/plugin-transform-private-property-in-object. | ||
The "loose" option must be the same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods and @babel/plugin-transform-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding | ||
["@babel/plugin-transform-private-methods", { "loose": true }] | ||
to the "plugins" section of your Babel config. | ||
|
||
If you already set the same 'loose' mode for these plugins in your config, it's possible that they are enabled multiple times with different options. | ||
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded configuration: | ||
npx cross-env BABEL_SHOW_CONFIG_FOR=<CWD>/packages/babel-preset-env/test/fixtures/loose-class-features-precedence/properties-loose-preset-not-loose-win/input.js <your build command> | ||
See https://babeljs.io/docs/configuration#print-effective-configs for more info. |
14 changes: 8 additions & 6 deletions
14
...t/fixtures/loose-class-features-precedence/properties-loose-preset-not-loose/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"os": ["darwin", "linux"], | ||
"validateLogs": true, | ||
"presets": [ | ||
["env", { | ||
"targets": { "node": 10 } | ||
}] | ||
[ | ||
"env", | ||
{ | ||
"targets": { "node": 10 } | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
["transform-class-properties", { "loose": true }] | ||
] | ||
"plugins": [["transform-class-properties", { "loose": true }]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...t/fixtures/loose-class-features-precedence/properties-not-loose-preset-loose-win/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class A { | ||
x = 2; | ||
|
||
#foo() {} | ||
} |
16 changes: 16 additions & 0 deletions
16
...xtures/loose-class-features-precedence/properties-not-loose-preset-loose-win/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"os": ["win32"], | ||
"validateLogs": true, | ||
"presets": [ | ||
[ | ||
"env", | ||
{ | ||
"targets": { "node": 10 }, | ||
"shippedProposals": true, | ||
"loose": true | ||
} | ||
] | ||
], | ||
"plugins": [["transform-class-properties", { "loose": false }]] | ||
} |
8 changes: 8 additions & 0 deletions
8
.../fixtures/loose-class-features-precedence/properties-not-loose-preset-loose-win/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var _foo = /*#__PURE__*/new WeakSet(); | ||
class A { | ||
constructor() { | ||
babelHelpers.classPrivateMethodInitSpec(this, _foo); | ||
babelHelpers.defineProperty(this, "x", 2); | ||
} | ||
} | ||
function _foo2() {} |
Oops, something went wrong.