* Modify test case to reproduce error * Fix TypeOnlyExport codefix to work with 3 or more type exports in the same declaration The check to ensure that a fixed export declaration wasn't fixed again was reversed. This only surfaced when 3 or more type exports existed in the same declaration. * Add failing test cases for comments being duplicated * Fix convertToTypeOnlyExport codefix from duplicating leading comments * Simplify convertToTypeOnlyExport when change is just inserting `type` keyword Co-authored-by: Andrew Branch <andrew@wheream.io>
22 lines
516 B
TypeScript
22 lines
516 B
TypeScript
/// <reference path="fourslash.ts" />
|
|
|
|
// @isolatedModules: true
|
|
|
|
// @Filename: /a.ts
|
|
////export type A = {};
|
|
////export type B = {};
|
|
|
|
// @Filename: /b.ts
|
|
/////* Comment */
|
|
////export { A, B } from './a';
|
|
|
|
goTo.file("/b.ts");
|
|
verify.codeFix({
|
|
index: 0,
|
|
description: ts.Diagnostics.Convert_to_type_only_export.message,
|
|
errorCode: ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type.code,
|
|
newFileContent:
|
|
`/* Comment */
|
|
export type { A, B } from './a';`
|
|
});
|