-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolHelp WantedYou can do thisYou can do this
Milestone
Description
π Search Terms
quick fix, verbatimModuleSyntax, value re-export
π Version & Regression Information
- This changed between versions 5.1.6 and 5.2.2
- This changed in PR Code fix should prefer
import typeΒ #54255
β― Playground Link
π» Code
// verbatimModuleSyntax: true
import { AbstractView, memo } from "react";
// ^^ two quick fixs including 'import type ...' β
export { type AbstractView, memo }
// compared to below:
import { TaintableUniqueValue, useMemo } from "react";
// ^^ only fix is inline 'type' β
export const useMemo2 = useMemo;
export type { TaintableUniqueValue }π Actual behavior
Quick fix is offering to convert the whole import to a import type.
π Expected behavior
Only offer a quick fix of marking the individual named import with type <name>
Additional information about the issue
This only appears to happen when the values being imported are only re-exported.
While a user is free to pick the more appropriate quick fix, it adds complexity when running the quickfixes on mass on large code bases where making individual judgment calls for each fix could take too long.
robpalme
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolHelp WantedYou can do thisYou can do this