b94061c587
* getEditsForFileRename: Avoid changing import specifier ending * Support .json and .jsx extensions * Restore typeRoots tests * Fix json test * When --jsx preserve is set, import ".tsx" file with ".jsx" extension * Support ending preference in UserPreferences
27 lines
686 B
TypeScript
27 lines
686 B
TypeScript
/// <reference path="fourslash.ts" />
|
|
|
|
// @moduleResolution: node
|
|
|
|
// @Filename: /foo/index.ts
|
|
////export const foo = 0;
|
|
|
|
// @Filename: /a.ts
|
|
////foo;
|
|
|
|
// @Filename: /b.ts
|
|
////foo;
|
|
|
|
// @Filename: /c.ts
|
|
////foo;
|
|
|
|
const tests: ReadonlyArray<[string, FourSlashInterface.UserPreferences["importModuleSpecifierEnding"], string]> = [
|
|
["/a.ts", "js", "./foo/index.js"],
|
|
["/b.ts", "index", "./foo/index"],
|
|
["/c.ts", "minimal", "./foo"],
|
|
];
|
|
|
|
for (const [fileName, importModuleSpecifierEnding, specifier] of tests) {
|
|
goTo.file(fileName);
|
|
verify.importFixAtPosition([`import { foo } from "${specifier}";\n\nfoo;`,], /*errorCode*/ undefined, { importModuleSpecifierEnding });
|
|
}
|