mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
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:
parent
31bf80ce6b
commit
10a3872de4
@ -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";
|
||||
|
||||
|
||||
22
tests/cases/fourslash/codeFixConvertToTypeOnlyImport8.ts
Normal file
22
tests/cases/fourslash/codeFixConvertToTypeOnlyImport8.ts
Normal 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";`,
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user