fix(57326): 'resolves to a type-only declaration and must be imported using a type-only import' doesn't have a quick fix (#57327)

This commit is contained in:
Oleksandr T 2024-02-08 01:17:29 +02:00 committed by GitHub
parent 31bf80ce6b
commit 10a3872de4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 0 deletions

View File

@ -28,6 +28,7 @@ import {
const errorCodes = [
Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code,
Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code,
Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code,
];
const fixId = "convertToTypeOnlyImport";

View File

@ -0,0 +1,22 @@
/// <reference path="fourslash.ts" />
// @verbatimModuleSyntax: true
// @module: esnext
// @moduleResolution: bundler
// @target: esnext
// @filename: /a.ts
////export function f() {}
// @Filename: /b.ts
////export type * as b from "./a.js";
// @Filename: /c.ts
////import { b } from "./b.js";
goTo.file("/c.ts");
verify.codeFix({
index: 0,
description: ts.Diagnostics.Use_import_type.message,
newFileContent: `import type { b } from "./b.js";`,
});