Skip to content

Commit

Permalink
Use type: module in all package.jsons (#16535)
Browse files Browse the repository at this point in the history
* Use `type: module` in all `package.json`s

* Remove now unnecessary `{ "type": "module" }` package.jsons

* Use `type: commonjs` where needed
  • Loading branch information
nicolo-ribaudo committed May 30, 2024
1 parent 33d6f70 commit 7934963
Show file tree
Hide file tree
Showing 302 changed files with 658 additions and 803 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
}
],
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -55,5 +55,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
}
],
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -55,5 +55,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}

This file was deleted.

2 changes: 1 addition & 1 deletion eslint/babel-eslint-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"node": "^10.13.0 || ^12.13.0 || >=14.0.0"
},
"main": "./lib/index.cjs",
"type": "commonjs",
"type": "module",
"exports": {
".": "./lib/index.cjs",
"./experimental-worker": "./lib/experimental-worker.cjs",
Expand Down
1 change: 0 additions & 1 deletion eslint/babel-eslint-parser/test/package.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"devDependencies": {
"eslint": "^8.22.0"
},
"type": "commonjs"
"type": "module"
}

This file was deleted.

2 changes: 1 addition & 1 deletion eslint/babel-eslint-plugin-development/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"author": "The Babel Team (https://babel.dev/team)",
"main": "./lib/index.cjs",
"type": "commonjs",
"type": "module",
"exports": {
".": "./lib/index.cjs",
"./package.json": "./package.json"
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion eslint/babel-eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "7.24.6",
"description": "Companion rules for @babel/eslint-parser",
"main": "./lib/index.cjs",
"type": "commonjs",
"type": "module",
"exports": {
".": "./lib/index.cjs",
"./package.json": "./package.json"
Expand Down
1 change: 0 additions & 1 deletion eslint/babel-eslint-plugin/test/rules/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion eslint/babel-eslint-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"eslint-plugin-import": "^2.25.4",
"npm-babel-parser": "npm:@babel/parser@^7.14.0"
},
"type": "commonjs"
"type": "module"
}
1 change: 0 additions & 1 deletion eslint/babel-eslint-tests/test/package.json

This file was deleted.

7 changes: 4 additions & 3 deletions packages/babel-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@
],
"USE_ESM": [
{
"type": "module",
"bin": {
"babel": "./bin/babel.mjs",
"babel-external-helpers": "./bin/babel-external-helpers.mjs"
}
},
null
{
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -82,5 +83,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}
1 change: 0 additions & 1 deletion packages/babel-cli/test/package.json

This file was deleted.

8 changes: 4 additions & 4 deletions packages/babel-code-frame/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
}
],
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -51,5 +51,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}
1 change: 0 additions & 1 deletion packages/babel-code-frame/test/package.json

This file was deleted.

7 changes: 4 additions & 3 deletions packages/babel-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
],
"USE_ESM": [
{
"type": "module",
"exports": {
".": {
"types": "./lib/index.d.ts",
Expand All @@ -109,7 +108,9 @@
"./package.json": "./package.json"
}
},
null
{
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -120,5 +121,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}
1 change: 0 additions & 1 deletion packages/babel-core/test/package.json

This file was deleted.

8 changes: 4 additions & 4 deletions packages/babel-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
}
],
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -59,5 +59,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}
1 change: 0 additions & 1 deletion packages/babel-generator/test/package.json

This file was deleted.

8 changes: 4 additions & 4 deletions packages/babel-helper-annotate-as-pure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
}
],
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -48,5 +48,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}
1 change: 0 additions & 1 deletion packages/babel-helper-annotate-as-pure/test/package.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
}
],
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -48,5 +48,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}
8 changes: 4 additions & 4 deletions packages/babel-helper-builder-react-jsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
}
],
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -50,5 +50,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}
1 change: 0 additions & 1 deletion packages/babel-helper-builder-react-jsx/test/package.json

This file was deleted.

8 changes: 4 additions & 4 deletions packages/babel-helper-check-duplicate-nodes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
"devDependencies": {
"@babel/core": "workspace:^"
},
"type": "commonjs",
"type": "module",
"conditions": {
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
],
"BABEL_8_BREAKING": [
{
Expand Down

This file was deleted.

8 changes: 4 additions & 4 deletions packages/babel-helper-compilation-targets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs",
"type": "module",
"conditions": {
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
],
"BABEL_8_BREAKING": [
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
}
],
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -66,5 +66,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
}
],
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -57,5 +57,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}

This file was deleted.

8 changes: 4 additions & 4 deletions packages/babel-helper-environment-visitor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"node": ">=6.9.0"
},
"author": "The Babel Team (https://babel.dev/team)",
"type": "commonjs",
"type": "module",
"conditions": {
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
],
"BABEL_8_BREAKING": [
{
Expand Down
8 changes: 4 additions & 4 deletions packages/babel-helper-fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
}
],
"USE_ESM": [
null,
{
"type": "module"
},
null
"type": "commonjs"
}
]
},
"exports": {
Expand All @@ -50,5 +50,5 @@
},
"./package.json": "./package.json"
},
"type": "commonjs"
"type": "module"
}
Loading

0 comments on commit 7934963

Please sign in to comment.