Skip to content

Commit 10a3872

Browse files
authored
fix(57326): 'resolves to a type-only declaration and must be imported using a type-only import' doesn't have a quick fix (#57327)
1 parent 31bf80c commit 10a3872

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/services/codefixes/convertToTypeOnlyImport.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
const errorCodes = [
2929
Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code,
3030
Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code,
31+
Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code,
3132
];
3233
const fixId = "convertToTypeOnlyImport";
3334

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @verbatimModuleSyntax: true
4+
// @module: esnext
5+
// @moduleResolution: bundler
6+
// @target: esnext
7+
8+
// @filename: /a.ts
9+
////export function f() {}
10+
11+
// @Filename: /b.ts
12+
////export type * as b from "./a.js";
13+
14+
// @Filename: /c.ts
15+
////import { b } from "./b.js";
16+
17+
goTo.file("/c.ts");
18+
verify.codeFix({
19+
index: 0,
20+
description: ts.Diagnostics.Use_import_type.message,
21+
newFileContent: `import type { b } from "./b.js";`,
22+
});

0 commit comments

Comments
 (0)