microsoft / microsoft/TypeScript
Paste with imports duplicates imports for namespace imports
Offen
@navya9singh arbeitet bereits daran.
Seit 12.11.2024.
Needs Investigation
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
🔎 Search Terms
- paste with imports
- paste update imports
🕗 Version & Regression Information
5.7.0-dev.20241030
⏯ Playground Link
No response
💻 Code
consts.ts
export const a = 123;
console.log(a);
index.ts
import * as consts from "./consts";
console.log(consts.a);
- In
consts.ts, copyconsole.log(a); - Paste into
index.ts
🙁 Actual behavior
Imports get duplicated:
import * as consts from "./consts";
import { a } from "./consts";
console.log(consts.a);
console.log(a);
🙂 Expected behavior
It should rewrite the code to use the existing import:
import * as consts from "./consts";
console.log(consts.a);
console.log(consts.a);
Additional information about the issue
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.