Skip to content

Commit 45ca675

Browse files
schu34nicolo-ribaudo
authored andcommitted
use console.warn for warning (#9992)
* use console.warn for warning * fix tests
1 parent b1826bf commit 45ca675

File tree

13 files changed

+37
-44
lines changed

13 files changed

+37
-44
lines changed

packages/babel-preset-env/src/normalize-options.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export function normalizeCoreJSOption(
203203

204204
if (useBuiltIns && corejs === undefined) {
205205
rawVersion = 2;
206-
console.log(
206+
console.warn(
207207
"\nWARNING: We noticed you're using the `useBuiltIns` option without declaring a " +
208208
"core-js version. Currently, we assume version 2.x when no version " +
209209
"is passed. Since this default version will likely change in future " +
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2+
3+
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4+
5+
npm install --save core-js@2 npm install --save core-js@3
6+
yarn add core-js@2 yarn add core-js@3

packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/stdout.txt

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2-
3-
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4-
5-
npm install --save core-js@2 npm install --save core-js@3
6-
yarn add core-js@2 yarn add core-js@3
7-
81
@babel/preset-env: `DEBUG` option
92

103
Using targets:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2+
3+
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4+
5+
npm install --save core-js@2 npm install --save core-js@3
6+
yarn add core-js@2 yarn add core-js@3

packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/stdout.txt

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2-
3-
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4-
5-
npm install --save core-js@2 npm install --save core-js@3
6-
yarn add core-js@2 yarn add core-js@3
7-
81
@babel/preset-env: `DEBUG` option
92

103
Using targets:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2+
3+
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4+
5+
npm install --save core-js@2 npm install --save core-js@3
6+
yarn add core-js@2 yarn add core-js@3

packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/stdout.txt

-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2-
3-
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4-
5-
npm install --save core-js@2 npm install --save core-js@3
6-
yarn add core-js@2 yarn add core-js@3
7-
8-
91
The uglify target has been deprecated. Set the top level
102
option `forceAllTransforms: true` instead.
113

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2+
3+
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4+
5+
npm install --save core-js@2 npm install --save core-js@3
6+
yarn add core-js@2 yarn add core-js@3

packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/stdout.txt

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2-
3-
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4-
5-
npm install --save core-js@2 npm install --save core-js@3
6-
yarn add core-js@2 yarn add core-js@3
7-
81
@babel/preset-env: `DEBUG` option
92

103
Using targets:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2+
3+
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4+
5+
npm install --save core-js@2 npm install --save core-js@3
6+
yarn add core-js@2 yarn add core-js@3

packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/stdout.txt

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2-
3-
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4-
5-
npm install --save core-js@2 npm install --save core-js@3
6-
yarn add core-js@2 yarn add core-js@3
7-
81
@babel/preset-env: `DEBUG` option
92

103
Using targets:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2+
3+
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4+
5+
npm install --save core-js@2 npm install --save core-js@3
6+
yarn add core-js@2 yarn add core-js@3

packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/stdout.txt

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
2-
3-
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
4-
5-
npm install --save core-js@2 npm install --save core-js@3
6-
yarn add core-js@2 yarn add core-js@3
7-
81
@babel/preset-env: `DEBUG` option
92

103
Using targets:

0 commit comments

Comments
 (0)