Closed
Description
With "importsNotUsedAsValues": "error"
in tsconfig.json
, import { type T }
is no longer a valid TypeScript code.
I hope there could be a code fix:
import { type A, type B } from "./mod";
// ↓
import type { A, B } from "./mod";
while still preserve this as-is:
import { A, type B } from "./mod";
Valid Code
import { A, B } from "./mod"; // for normal imports
import { type A, B } from "./mod"; // for mixed imports
import type { T } from "./mod"; // for type-only imports
TypeScript Compiler Behavior
"importsNotUsedAsValues": "remove"
import type { T } from "./mod";
// ↓
export {};
import { type T } from "./mod";
// ↓
export {};
"importsNotUsedAsValues": "error"
import type { T } from "./mod";
// ↓
export {};
// @ts-expect-error ts(1371)
import { type T } from "./mod";
// ↓
import "./mod";
Metadata
Metadata
Assignees
Labels
No labels