Skip to content

Commit 71c558b

Browse files
[tsconfig] Update for TypeScript 5.8 (#4503)
* [tsconfig] Update for TypeScript 5.8 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add `rewriteRelativeImportExtensions` * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 62fcd07 commit 71c558b

File tree

5 files changed

+55
-2
lines changed

5 files changed

+55
-2
lines changed

src/schemas/json/jsconfig.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@
291291
"type": ["boolean", "null"],
292292
"markdownDescription": "Enforces using indexed accessors for keys declared using an indexed type\n\nSee more: https://www.typescriptlang.org/tsconfig#noPropertyAccessFromIndexSignature"
293293
},
294+
"erasableSyntaxOnly": {
295+
"description": "Do not allow runtime constructs that are not part of ECMAScript.",
296+
"type": ["boolean", "null"],
297+
"default": false,
298+
"markdownDescription": "Do not allow runtime constructs that are not part of ECMAScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#erasableSyntaxOnly"
299+
},
294300
"emitBOM": {
295301
"$comment": "The value of 'null' is UNDOCUMENTED (https://github.com/microsoft/TypeScript/pull/18058).",
296302
"description": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.",
@@ -406,12 +412,13 @@
406412
"None",
407413
"ES2022",
408414
"Node16",
415+
"Node18",
409416
"NodeNext",
410417
"Preserve"
411418
]
412419
},
413420
{
414-
"pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|20(1[567]|2[02])|[Nn][Ee][Xx][Tt])|[Nn][Oo][dD][Ee]16|[Nn][Oo][Dd][Ee][Nn][Ee][Xx][Tt]|[Nn][Oo][Nn][Ee]|[Pp][Rr][Ee][Ss][Ee][Rr][Vv][Ee])$"
421+
"pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|20(1[567]|2[02])|[Nn][Ee][Xx][Tt])|[Nn][Oo][dD][Ee]1[68]|[Nn][Oo][Dd][Ee][Nn][Ee][Xx][Tt]|[Nn][Oo][Nn][Ee]|[Pp][Rr][Ee][Ss][Ee][Rr][Vv][Ee])$"
415422
}
416423
],
417424
"markdownDescription": "Specify what module code is generated.\n\nSee more: https://www.typescriptlang.org/tsconfig#module"
@@ -594,6 +601,12 @@
594601
"default": false,
595602
"markdownDescription": "Disable emitting comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#removeComments"
596603
},
604+
"rewriteRelativeImportExtensions": {
605+
"description": "Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files.",
606+
"type": ["boolean", "null"],
607+
"default": false,
608+
"markdownDescription": "Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files.\n\nSee more: https://www.typescriptlang.org/tsconfig#rewriteRelativeImportExtensions"
609+
},
597610
"rootDir": {
598611
"$comment": "The value of 'null' is UNDOCUMENTED (https://github.com/microsoft/TypeScript/pull/18058).",
599612
"description": "Specify the root folder within your source files.",
@@ -1052,6 +1065,12 @@
10521065
},
10531066
"markdownDescription": "Specify a set of bundled library declaration files that describe the target runtime environment.\n\nSee more: https://www.typescriptlang.org/tsconfig#lib"
10541067
},
1068+
"libReplacement": {
1069+
"description": "Enable lib replacement.",
1070+
"type": ["boolean", "null"],
1071+
"default": true,
1072+
"markdownDescription": "Enable lib replacement.\n\nSee more: https://www.typescriptlang.org/tsconfig#libReplacement"
1073+
},
10551074
"strictNullChecks": {
10561075
"$comment": "The value of 'null' is UNDOCUMENTED (https://github.com/microsoft/TypeScript/pull/18058).",
10571076
"description": "When type checking, take into account `null` and `undefined`.",

src/schemas/json/tsconfig.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@
308308
"default": false,
309309
"markdownDescription": "Only output d.ts files and not JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitDeclarationOnly"
310310
},
311+
"erasableSyntaxOnly": {
312+
"description": "Do not allow runtime constructs that are not part of ECMAScript.",
313+
"type": ["boolean", "null"],
314+
"default": false,
315+
"markdownDescription": "Do not allow runtime constructs that are not part of ECMAScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#erasableSyntaxOnly"
316+
},
311317
"exactOptionalPropertyTypes": {
312318
"$comment": "The value of 'null' is UNDOCUMENTED (https://github.com/microsoft/TypeScript/pull/18058).",
313319
"description": "Differentiate between undefined and not present when type checking",
@@ -409,12 +415,13 @@
409415
"None",
410416
"ES2022",
411417
"Node16",
418+
"Node18",
412419
"NodeNext",
413420
"Preserve"
414421
]
415422
},
416423
{
417-
"pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|20(1[567]|2[02])|[Nn][Ee][Xx][Tt])|[Nn][Oo][dD][Ee]16|[Nn][Oo][Dd][Ee][Nn][Ee][Xx][Tt]|[Nn][Oo][Nn][Ee]|[Pp][Rr][Ee][Ss][Ee][Rr][Vv][Ee])$"
424+
"pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|20(1[567]|2[02])|[Nn][Ee][Xx][Tt])|[Nn][Oo][dD][Ee]1[68]|[Nn][Oo][Dd][Ee][Nn][Ee][Xx][Tt]|[Nn][Oo][Nn][Ee]|[Pp][Rr][Ee][Ss][Ee][Rr][Vv][Ee])$"
418425
}
419426
],
420427
"markdownDescription": "Specify what module code is generated.\n\nSee more: https://www.typescriptlang.org/tsconfig#module"
@@ -598,6 +605,12 @@
598605
"default": false,
599606
"markdownDescription": "Disable emitting comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#removeComments"
600607
},
608+
"rewriteRelativeImportExtensions": {
609+
"description": "Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files.",
610+
"type": ["boolean", "null"],
611+
"default": false,
612+
"markdownDescription": "Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files.\n\nSee more: https://www.typescriptlang.org/tsconfig#rewriteRelativeImportExtensions"
613+
},
601614
"rootDir": {
602615
"$comment": "The value of 'null' is UNDOCUMENTED (https://github.com/microsoft/TypeScript/pull/18058).",
603616
"description": "Specify the root folder within your source files.",
@@ -1056,6 +1069,12 @@
10561069
},
10571070
"markdownDescription": "Specify a set of bundled library declaration files that describe the target runtime environment.\n\nSee more: https://www.typescriptlang.org/tsconfig#lib"
10581071
},
1072+
"libReplacement": {
1073+
"description": "Enable lib replacement.",
1074+
"type": ["boolean", "null"],
1075+
"default": true,
1076+
"markdownDescription": "Enable lib replacement.\n\nSee more: https://www.typescriptlang.org/tsconfig#libReplacement"
1077+
},
10591078
"moduleDetection": {
10601079
"description": "Specify how TypeScript determine a file as module.",
10611080
"enum": ["auto", "legacy", "force"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"compilerOptions": {
3+
"erasableSyntaxOnly": true,
4+
"libReplacement": true,
5+
"module": "node18"
6+
}
7+
}

src/test/tsconfig/tsconfig-typescript5.7.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"es2024.sharedmemory",
1212
"es2024.string"
1313
],
14+
"rewriteRelativeImportExtensions": true,
1415
"target": "es2024"
1516
}
1617
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"compilerOptions": {
3+
"erasableSyntaxOnly": true,
4+
"libReplacement": true,
5+
"module": "node18"
6+
}
7+
}

0 commit comments

Comments
 (0)