Skip to content

Convert to namespace import refactoring should drop file extensions on namespace name #60505

Description

@mjbvz

🔎 Search Terms

  • Convert named import to namespace import

🕗 Version & Regression Information

5.8.0-dev.20241114

not a regression

⏯ Playground Link

No response

💻 Code

For code such as:

import { abc } from "./a.js";

console.log(abc);
  1. Run convert to namespace import

🙁 Actual behavior

The new namespace name is aJs:

import * as aJs from "./a.js";

console.log(aJs.abc);

🙂 Expected behavior

It would be better to drop the file extension as part of the name:

import * as a from "./a.js";

console.log(a.abc);

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