microsoft / microsoft/TypeScript
Paste with imports duplicates imports for namespace imports
Đang mở
@navya9singh đang làm issue này rồi.
Từ ngày 12/11/2024.
Needs Investigation
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.4k
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 117
Mô tả
🔎 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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Đánh giá
Issue này chưa được đánh giá.