Skip to content

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

Closed
@mjbvz

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