microsoft / microsoft/TypeScript

typescript auto import includes from `node_modules`

Đang mở
#61,634 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Needs More Info
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

Type: Bug

Image

including from node_modules should be opt-out by default, because 99% of time you do not want to import from `node_modules`.
adding exclude: ["node_modules"] in tsconfig.json doesn't work either.
neither version from, typescript `5.8.3` installed from node_modules nor `5.9.0-dev.20250429` fixes this issue.

VS Code version: Code - Insiders 1.100.0-insider (Universal) (ecbbe26188235072fbde7b6f4fd2a0bd6a7c9909, 2025-04-29T05:04:19.843Z)
OS version: Darwin arm64 24.1.0
Modes:

System Info

|Item|Value|
|---|---|
|CPUs|Apple M1 Pro (10 x 2400)|
|GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off|
|Load (avg)|6, 5, 4|
|Memory (System)|16.00GB (0.08GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
Extensions (91)

Extension|Author (truncated)|Version
---|---|---
vscode-userscript|adp|1.3.2
open-folder-in-explorer|adr|1.2.0
vscode-zipfs|arc|3.0.0
github-markdown-preview|bie|0.3.0
jsdoc-markdown-highlighting|bie|0.0.1
markdown-mermaid|bie|1.28.0
markdown-preview-github-styles|bie|2.1.0
biome|bio|2025.4.271358
vscode-fish|bma|1.0.39
mermaid-markdown-syntax-highlighting|bpr|1.7.0
package-json-upgrade|cod|3.2.1
gitignore|cod|0.10.0
vscode-eslint|dba|3.0.10
vscode-deno|den|3.44.0
gitlens|eam|17.0.3
comment-anchors|Exo|1.10.4
dependi|fil|0.7.13
shell-format|fox|7.2.5
gettext|get|1.0.4
copilot|Git|1.311.0
copilot-chat|Git|0.27.2025042903
vscode-github-actions|git|0.27.1
vscode-pull-request-github|Git|0.109.2025042904
todo-tree|Gru|0.0.226
applescript|idl|0.27.1
vscode-env|Iro|0.1.0
vscode-codeowners|jas|1.1.1
vscode-default-keybindings|jbr|0.2.20
gruvbox-material-icon-theme|Jon|1.1.5
vscode-gutter-preview|kis|0.32.2
vscode-package-json-inspector|kri|0.2.0
color-picker|Mar|1.0.0
git-graph|mhu|1.30.0
vscode-docker|ms-|1.29.6
vscode-language-pack-ko|MS-|1.100.2025042309
vscode-dotnet-runtime|ms-|2.3.3
playwright|ms-|1.1.14
python|ms-|2025.4.0
jupyter|ms-|2025.3.0
jupyter-keymap|ms-|1.1.2
jupyter-renderers|ms-|1.1.0
vscode-jupyter-cell-tags|ms-|0.1.9
vscode-jupyter-slideshow|ms-|0.1.6
remote-containers|ms-|0.412.0
remote-ssh|ms-|0.119.0
remote-ssh-edit|ms-|0.87.0
vscode-remote-extensionpack|ms-|0.26.0
live-server|ms-|0.4.15
remote-explorer|ms-|0.4.3
vscode-typescript-next|ms-|5.9.20250429
vsliveshare|ms-|1.0.5948
export-typescript|msc|0.4.2
sqltools|mtx|0.28.4
sqltools-driver-mysql|mtx|0.6.4
sqltools-driver-sqlite|mtx|0.5.2
nimvscode|nim|0.1.26
vscode-mogami|nin|0.0.43
vscode-twoslash-queries|Ort|1.5.0
sqlite-viewer|qwt|0.10.5
diff|raf|0.0.1
vscode-yaml|red|1.18.0
schemastore|rem|1.0.225
extra-context|rio|0.6.0
nunjucks|ron|0.3.1
vscode-coverage-gutters|rya|2.13.0
vscode-hsx|s0k|0.5.1
python-inline-source|sam|0.0.2
scala|sca|0.5.9
metals|sca|1.49.4
uridecode|sry|0.3.6
stately-vscode|sta|2.1.0
lua|sum|3.14.0
rust-pack|Swe|0.3.38
even-better-toml|tam|0.21.2
markdown-links|tch|0.8.0
open-in-browser|tec|2.0.0
shellcheck|tim|0.37.7
graphviz-interactive-preview|tin|0.3.5
vscode-choosealicense|ult|0.9.4
vscode-mdx|uni|1.8.14
errorlens|use|3.26.0
intellicode-api-usage-examples|Vis|0.2.9
vscodeintellicode|Vis|1.3.2
explorer|vit|1.18.0
vscode-conventional-commits|viv|1.26.0
vscode-wakatime|Wak|25.0.1
vscode-import-cost|wix|3.3.0
gitconfig-lsp|yy0|0.10.2
markdown-all-in-one|yzh|3.6.3
material-theme|zhu|3.19.0
vscode-open-in-github|ziy|1.3.6

(7 theme extensions excluded)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện hành vi tự động import trong VS Code với TypeScript 5.8.3 hoặc bản build 5.9.0-dev được báo cáo, sử dụng tsconfig.json với exclude: ["node_modules"]. Truy vết xem entry point tự động import nào của TypeScript tạo ra gợi ý từ node_modules; hoàn tất khi các import từ node_modules được loại trừ theo mặc định trong khi vẫn giữ nguyên hành vi opt-out được yêu cầu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
developer-experience, tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
32/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.