TypeScript/tests/cases/fourslash/importNameCodeFix_avoidRelativeNodeModules.ts
Andrew Branch 03c79d7422
Insert auto-imports in sorted order (#39394)
* Sort auto-imports

* Avoid re-checking sort all the time

* Add comment
2020-07-08 15:25:04 -07:00

28 lines
682 B
TypeScript

/// <reference path="fourslash.ts" />
// @Filename: /a/index.d.ts
// @Symlink: /b/node_modules/a/index.d.ts
// @Symlink: /c/node_modules/a/index.d.ts
////export const a: number;
// @Filename: /b/index.ts
// @Symlink: /c/node_modules/b/index.d.ts
////import { a } from 'a'
////export const b: number;
// @Filename: /c/a_user.ts
// Importing from "a" to get /c/node_modules/a in the project.
// Must do this in a separate file to avoid import fixes attempting to share the import.
////import { a } from "a";
// @Filename: /c/foo.ts
////[|import { b } from "b";
////a;|]
goTo.file("/c/foo.ts");
verify.importFixAtPosition([
`import { a } from "a";
import { b } from "b";
a;`,
]);