Use "module": "Preserve" (#19655)

Co-authored-by: Matt Pocock <mattpocockvoice@gmail.com>
This commit is contained in:
Alistair Smith
2025-05-14 18:43:15 -07:00
committed by GitHub
parent a5358fbbd9
commit 6e063fa57b
10 changed files with 13 additions and 9 deletions

1
.gitattributes vendored
View File

@@ -54,3 +54,4 @@ test/js/node/test/common linguist-vendored
test/js/bun/css/files linguist-vendored test/js/bun/css/files linguist-vendored
.vscode/*.json linguist-language=JSON-with-Comments .vscode/*.json linguist-language=JSON-with-Comments
src/cli/init/tsconfig.default.json linguist-language=JSON-with-Comments

View File

@@ -3,7 +3,7 @@
// Enable latest features // Enable latest features
"lib": ["ESNext"], "lib": ["ESNext"],
"target": "ESNext", "target": "ESNext",
"module": "ESNext", "module": "Preserve",
"moduleDetection": "force", "moduleDetection": "force",
"jsx": "react-jsx", "jsx": "react-jsx",
"allowJs": true, "allowJs": true,

View File

@@ -3,7 +3,7 @@
// Enable latest features // Enable latest features
"lib": ["ESNext"], "lib": ["ESNext"],
"target": "ESNext", "target": "ESNext",
"module": "ESNext", "module": "Preserve",
"moduleDetection": "force", "moduleDetection": "force",
"jsx": "react-jsx", "jsx": "react-jsx",
"allowJs": true, "allowJs": true,

View File

@@ -18,7 +18,7 @@ Below is the full set of recommended `compilerOptions` for a Bun project. With t
// Environment setup & latest features // Environment setup & latest features
"lib": ["ESNext"], "lib": ["ESNext"],
"target": "ESNext", "target": "ESNext",
"module": "ESNext", "module": "Preserve",
"moduleDetection": "force", "moduleDetection": "force",
"jsx": "react-jsx", "jsx": "react-jsx",
"allowJs": true, "allowJs": true,
@@ -34,6 +34,7 @@ Below is the full set of recommended `compilerOptions` for a Bun project. With t
"skipLibCheck": true, "skipLibCheck": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true, "noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
// Some stricter flags (disabled by default) // Some stricter flags (disabled by default)
"noUnusedLocals": false, "noUnusedLocals": false,

View File

@@ -58,7 +58,7 @@ Then add the following to your `compilerOptions` in `tsconfig.json`:
"compilerOptions": { "compilerOptions": {
"lib": ["ESNext"], "lib": ["ESNext"],
"target": "ESNext", "target": "ESNext",
"module": "ESNext", "module": "Preserve",
"moduleDetection": "force", "moduleDetection": "force",
"moduleResolution": "bundler", "moduleResolution": "bundler",
"allowImportingTsExtensions": true, "allowImportingTsExtensions": true,

View File

@@ -20,7 +20,7 @@ Bun supports things like top-level await, JSX, and extensioned `.ts` imports, wh
// Environment setup & latest features // Environment setup & latest features
"lib": ["ESNext"], "lib": ["ESNext"],
"target": "ESNext", "target": "ESNext",
"module": "ESNext", "module": "Preserve",
"moduleDetection": "force", "moduleDetection": "force",
"jsx": "react-jsx", "jsx": "react-jsx",
"allowJs": true, "allowJs": true,
@@ -36,6 +36,7 @@ Bun supports things like top-level await, JSX, and extensioned `.ts` imports, wh
"skipLibCheck": true, "skipLibCheck": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true, "noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
// Some stricter flags (disabled by default) // Some stricter flags (disabled by default)
"noUnusedLocals": false, "noUnusedLocals": false,

View File

@@ -3,7 +3,7 @@
// Environment setup & latest features // Environment setup & latest features
"lib": ["ESNext"], "lib": ["ESNext"],
"target": "ESNext", "target": "ESNext",
"module": "ESNext", "module": "Preserve",
"moduleDetection": "force", "moduleDetection": "force",
"jsx": "react-jsx", "jsx": "react-jsx",
"allowJs": true, "allowJs": true,
@@ -19,6 +19,7 @@
"skipLibCheck": true, "skipLibCheck": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true, "noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
// Some stricter flags (disabled by default) // Some stricter flags (disabled by default)
"noUnusedLocals": false, "noUnusedLocals": false,

View File

@@ -1,7 +1,7 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ESNext", "target": "ESNext",
"module": "ESNext", "module": "Preserve",
"moduleResolution": "bundler", "moduleResolution": "bundler",
"jsx": "react-jsx", "jsx": "react-jsx",
"allowJs": true, "allowJs": true,

View File

@@ -5,7 +5,7 @@
// Bundler mode // Bundler mode
"moduleResolution": "bundler", "moduleResolution": "bundler",
"module": "preserve", "module": "Preserve",
"allowImportingTsExtensions": true, "allowImportingTsExtensions": true,
"verbatimModuleSyntax": true, "verbatimModuleSyntax": true,
"noEmit": true, "noEmit": true,

View File

@@ -1,7 +1,7 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ESNext", "target": "ESNext",
"module": "ESNext", "module": "Preserve",
"moduleResolution": "bundler", "moduleResolution": "bundler",
"jsx": "react-jsx", "jsx": "react-jsx",
"allowJs": true, "allowJs": true,