Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mjbvz opened this issue Nov 15, 2024 · 0 comments Β· Fixed by #60510
Closed

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

mjbvz opened this issue Nov 15, 2024 · 0 comments Β· Fixed by #60510
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Nov 15, 2024

πŸ”Ž 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
2 participants