Skip to content

Incorrect "Import may be converted to a default import" autofix for import export #61167

@nicolo-ribaudo

Description

@nicolo-ribaudo

🔎 Search Terms

Import may be converted to a default import autofix suggestion vscode

🕗 Version & Regression Information

  • It's happening on 5.7.3, unfortunately I don't know how to easily test autofix suggestions in older versions (can I do it from the cli?)

⏯ Playground Link

No response

💻 Code

export import foo = require("gensync-BABEL_8_BREAKING-true");

🙁 Actual behavior

VSCode says "Import may be converted to a default import. ts(80003)", and when I accept the suggestion it generates this code:

import foo from "gensync-BABEL_8_BREAKING-true";

🙂 Expected behavior

It should not suggest code that it's not equivalent (because it's not exporting foo).

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions