Skip to content

fix: also respect compilerOptions.moduleResolution for ending preferences #53244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/// <reference path="fourslash.ts"/>

// @Filename: /tsconfig.json
////{
//// "compilerOptions": {
//// "moduleResolution": "Node16",
//// }
////}

// @Filename: /src/main.ts
////[|export function someLibFn(): string {
//// return main();
////}|]
////
////function main(): string {
//// return "hello world!";
////}
////console.log(someLibFn());

// @Filename: /other.ts
////import { someLibFn } from "./src/main";
////
////function someOtherFn(): string {
//// return someLibFn();
////}

// @Filename: /act/action.ts
////import { someLibFn } from "../src/main";
////
////function doAction(): string {
//// return someLibFn();
////}


verify.moveToNewFile({
newFileContents: {
"/src/main.ts":
`import { someLibFn } from "./someLibFn";

export function main(): string {
return "hello world!";
}
console.log(someLibFn());`,

"/src/someLibFn.ts":
`import { main } from "./main";

export function someLibFn(): string {
return main();
}
`,

"/other.ts":
`import { someLibFn } from "./src/someLibFn";

function someOtherFn(): string {
return someLibFn();
}`,

"/act/action.ts":
`import { someLibFn } from "../src/someLibFn";

function doAction(): string {
return someLibFn();
}`,
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/// <reference path="fourslash.ts"/>

// @Filename: /src/main.ts
////import { message } from "./message.js";
////
////[|export function someLibFn(): string {
//// return main();
////}|]
////
////function main(): string {
//// return message;
////}
////console.log(someLibFn());

// @Filename: /message.ts
////export const message = "hello world";

// @Filename: /other.ts
////import { someLibFn } from "./src/main.js";
////
////function someOtherFn(): string {
//// return someLibFn();
////}

// @Filename: /act/action.ts
////import { someLibFn } from "../src/main.js";
////
////function doAction(): string {
//// return someLibFn();
////}


verify.moveToNewFile({
newFileContents: {
"/src/main.ts":
`import { message } from "./message.js";
import { someLibFn } from "./someLibFn.js";

export function main(): string {
return message;
}
console.log(someLibFn());`,

"/src/someLibFn.ts":
`import { main } from "./main.js";


export function someLibFn(): string {
return main();
}
`,

"/other.ts":
`import { someLibFn } from "./src/someLibFn.js";

function someOtherFn(): string {
return someLibFn();
}`,

"/act/action.ts":
`import { someLibFn } from "../src/someLibFn.js";

function doAction(): string {
return someLibFn();
}`,
}
});