-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require module/moduleResolution to match when either is node16/nodenext
- Loading branch information
1 parent
fbd63e9
commit 9a775a4
Showing
36 changed files
with
648 additions
and
750 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tests/baselines/reference/allowImportingTsExtensions(moduleresolution=node16).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tests/baselines/reference/allowImportingTsExtensions(moduleresolution=nodenext).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ingTypesDtsExtension(allowimportingtsextensions=false,moduleresolution=node16).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
|
||
|
||
!!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
==== /types.d.ts (0 errors) ==== | ||
export declare type User = { | ||
name: string; | ||
} | ||
|
||
==== /a.ts (0 errors) ==== | ||
import type { User } from "./types.d.ts"; | ||
export type { User } from "./types.d.ts"; | ||
|
||
export const user: User = { name: "John" }; | ||
|
||
export function getUser(): import("./types.d.ts").User { | ||
return user; | ||
} | ||
|
19 changes: 19 additions & 0 deletions
19
...gTypesDtsExtension(allowimportingtsextensions=false,moduleresolution=nodenext).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. | ||
|
||
|
||
!!! error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. | ||
==== /types.d.ts (0 errors) ==== | ||
export declare type User = { | ||
name: string; | ||
} | ||
|
||
==== /a.ts (0 errors) ==== | ||
import type { User } from "./types.d.ts"; | ||
export type { User } from "./types.d.ts"; | ||
|
||
export const user: User = { name: "John" }; | ||
|
||
export function getUser(): import("./types.d.ts").User { | ||
return user; | ||
} | ||
|
19 changes: 19 additions & 0 deletions
19
...tingTypesDtsExtension(allowimportingtsextensions=true,moduleresolution=node16).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
|
||
|
||
!!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
==== /types.d.ts (0 errors) ==== | ||
export declare type User = { | ||
name: string; | ||
} | ||
|
||
==== /a.ts (0 errors) ==== | ||
import type { User } from "./types.d.ts"; | ||
export type { User } from "./types.d.ts"; | ||
|
||
export const user: User = { name: "John" }; | ||
|
||
export function getUser(): import("./types.d.ts").User { | ||
return user; | ||
} | ||
|
19 changes: 19 additions & 0 deletions
19
...ngTypesDtsExtension(allowimportingtsextensions=true,moduleresolution=nodenext).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. | ||
|
||
|
||
!!! error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. | ||
==== /types.d.ts (0 errors) ==== | ||
export declare type User = { | ||
name: string; | ||
} | ||
|
||
==== /a.ts (0 errors) ==== | ||
import type { User } from "./types.d.ts"; | ||
export type { User } from "./types.d.ts"; | ||
|
||
export const user: User = { name: "John" }; | ||
|
||
export function getUser(): import("./types.d.ts").User { | ||
return user; | ||
} | ||
|
31 changes: 31 additions & 0 deletions
31
...elines/reference/conditionalExportsResolutionFallback(moduleresolution=node16).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
|
||
|
||
!!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
==== /node_modules/dep/package.json (0 errors) ==== | ||
// This documents bug https://github.com/microsoft/TypeScript/issues/50762. | ||
|
||
{ | ||
"name": "dep", | ||
"version": "1.0.0", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
} | ||
} | ||
} | ||
|
||
==== /node_modules/dep/dist/index.d.ts (0 errors) ==== | ||
export {}; | ||
|
||
==== /node_modules/dep/dist/index.mjs (0 errors) ==== | ||
export {}; | ||
|
||
==== /index.mts (0 errors) ==== | ||
import {} from "dep"; | ||
// Should be an untyped resolution to dep/dist/index.mjs, | ||
// but the first search is only for TS files, and when | ||
// there's no dist/index.d.mts, it continues looking for | ||
// matching conditions and resolves via `types`. |
31 changes: 31 additions & 0 deletions
31
...ines/reference/conditionalExportsResolutionFallback(moduleresolution=nodenext).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. | ||
|
||
|
||
!!! error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'. | ||
==== /node_modules/dep/package.json (0 errors) ==== | ||
// This documents bug https://github.com/microsoft/TypeScript/issues/50762. | ||
|
||
{ | ||
"name": "dep", | ||
"version": "1.0.0", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
} | ||
} | ||
} | ||
|
||
==== /node_modules/dep/dist/index.d.ts (0 errors) ==== | ||
export {}; | ||
|
||
==== /node_modules/dep/dist/index.mjs (0 errors) ==== | ||
export {}; | ||
|
||
==== /index.mts (0 errors) ==== | ||
import {} from "dep"; | ||
// Should be an untyped resolution to dep/dist/index.mjs, | ||
// but the first search is only for TS files, and when | ||
// there's no dist/index.d.mts, it continues looking for | ||
// matching conditions and resolves via `types`. |
31 changes: 31 additions & 0 deletions
31
tests/baselines/reference/elidedJSImport2(module=commonjs).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
|
||
|
||
!!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
==== tests/cases/compiler/index.js (0 errors) ==== | ||
import { Foo } from "./other.js"; | ||
import * as other from "./other.js"; | ||
import defaultFoo from "./other.js"; | ||
|
||
const x = new Foo(); | ||
const y = other.Foo(); | ||
const z = new defaultFoo(); | ||
|
||
==== tests/cases/compiler/other.d.ts (0 errors) ==== | ||
export interface Foo { | ||
bar: number; | ||
} | ||
|
||
export default interface Bar { | ||
foo: number; | ||
} | ||
|
||
==== tests/cases/compiler/other.js (0 errors) ==== | ||
export class Foo { | ||
bar = 2.4; | ||
} | ||
|
||
export default class Bar { | ||
foo = 1.2; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tests/baselines/reference/elidedJSImport2(module=es2022).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
|
||
|
||
!!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
==== tests/cases/compiler/index.js (0 errors) ==== | ||
import { Foo } from "./other.js"; | ||
import * as other from "./other.js"; | ||
import defaultFoo from "./other.js"; | ||
|
||
const x = new Foo(); | ||
const y = other.Foo(); | ||
const z = new defaultFoo(); | ||
|
||
==== tests/cases/compiler/other.d.ts (0 errors) ==== | ||
export interface Foo { | ||
bar: number; | ||
} | ||
|
||
export default interface Bar { | ||
foo: number; | ||
} | ||
|
||
==== tests/cases/compiler/other.js (0 errors) ==== | ||
export class Foo { | ||
bar = 2.4; | ||
} | ||
|
||
export default class Bar { | ||
foo = 1.2; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/emitHelpersWithLocalCollisions(module=node16).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node16'. | ||
|
||
|
||
!!! error TS5109: Option 'moduleResolution' must be set to 'Node16' (or left unspecified) when option 'module' is set to 'Node16'. | ||
==== tests/cases/compiler/a.ts (0 errors) ==== | ||
declare var dec: any, __decorate: any; | ||
@dec export class A { | ||
} | ||
|
||
const o = { a: 1 }; | ||
const y = { ...o }; | ||
|
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/emitHelpersWithLocalCollisions(module=nodenext).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. | ||
|
||
|
||
!!! error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. | ||
==== tests/cases/compiler/a.ts (0 errors) ==== | ||
declare var dec: any, __decorate: any; | ||
@dec export class A { | ||
} | ||
|
||
const o = { a: 1 }; | ||
const y = { ...o }; | ||
|
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/extensionLoadingPriority(moduleresolution=node16).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
|
||
|
||
!!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. | ||
==== /project/a.js (0 errors) ==== | ||
export default "a.js"; | ||
|
||
==== /project/a.js.js (0 errors) ==== | ||
export default "a.js.js"; | ||
|
||
==== /project/dir/index.ts (0 errors) ==== | ||
export default "dir/index.ts"; | ||
|
||
==== /project/dir.js (0 errors) ==== | ||
export default "dir.js"; | ||
|
||
==== /project/b.ts (0 errors) ==== | ||
import a from "./a.js"; | ||
import dir from "./dir"; | ||
|
Oops, something went wrong.