Skip to content

Commit 8458a61

Browse files
authored
Make ModuleResolutionKind.Node10 change backward-compatible (#53139)
1 parent 02cf0b6 commit 8458a61

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/compiler/types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6940,6 +6940,12 @@ export function diagnosticCategoryName(d: { category: DiagnosticCategory }, lowe
69406940

69416941
export enum ModuleResolutionKind {
69426942
Classic = 1,
6943+
/**
6944+
* @deprecated
6945+
* `NodeJs` was renamed to `Node10` to better reflect the version of Node that it targets.
6946+
* Use the new name or consider switching to a modern module resolution target.
6947+
*/
6948+
NodeJs = 2,
69436949
Node10 = 2,
69446950
// Starting with node12, node's module resolver has significant departures from traditional cjs resolution
69456951
// to better support ecmascript modules and their use within node - however more features are still being added.
@@ -6948,7 +6954,7 @@ export enum ModuleResolutionKind {
69486954
// In turn, we offer both a `NodeNext` moving resolution target, and a `Node16` version-anchored resolution target
69496955
Node16 = 3,
69506956
NodeNext = 99, // Not simply `Node16` so that compiled code linked against TS can use the `Next` value reliably (same as with `ModuleKind`)
6951-
Bundler = 100,
6957+
Bundler = 100,
69526958
}
69536959

69546960
export enum ModuleDetectionKind {

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6991,6 +6991,12 @@ declare namespace ts {
69916991
}
69926992
enum ModuleResolutionKind {
69936993
Classic = 1,
6994+
/**
6995+
* @deprecated
6996+
* `NodeJs` was renamed to `Node10` to better reflect the version of Node that it targets.
6997+
* Use the new name or consider switching to a modern module resolution target.
6998+
*/
6999+
NodeJs = 2,
69947000
Node10 = 2,
69957001
Node16 = 3,
69967002
NodeNext = 99,

tests/baselines/reference/api/typescript.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3048,6 +3048,12 @@ declare namespace ts {
30483048
}
30493049
enum ModuleResolutionKind {
30503050
Classic = 1,
3051+
/**
3052+
* @deprecated
3053+
* `NodeJs` was renamed to `Node10` to better reflect the version of Node that it targets.
3054+
* Use the new name or consider switching to a modern module resolution target.
3055+
*/
3056+
NodeJs = 2,
30513057
Node10 = 2,
30523058
Node16 = 3,
30533059
NodeNext = 99,

0 commit comments

Comments
 (0)