Investigate implicit excludes

未關閉
#35,121 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
25/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
typescript
領域
compilers

研究方向

首先重現 issue 中描述的 .js monorepo 配置,比較有無 jsconfig.json 以及使用明確 exclude 時的行為。調查目前隱含的 exclude 行為如何處理 node_modules 的不同位置以及點檔案。完成的標準是確立一種經過共識的方式,用於強制套用或停用所提議的模式。

由索引模型根據 Issue 內容生成。

描述

Domain: Performance

Today, TypeScript will implicitly set exclude to ./node_modules and something like .*/**/* to avoid dot files.

Unfortunately, there are two problems I believe I've found from chatting with users.

First, users often end up setting exclude which overrides the defaults. This often means that users accidentally over-include files, and that can cause performance issues.

Next, these defaults don't work out well enough, and end up going a bit off the rails in certain scenarios. For example, consider the following .js monorepo.

packages
+- package-aaa
|  +- node_modules    <- the cute tiny 10MB node_modules
|
+- jsconfig.json
+- node_modules        <- the slightly bigger 10GB node_modules
                         shared by each package

Notice that jsconfig.json or not, one of these node_modules is going to be crawled through unless exclude is set appropriately. And regardless of whether exclude is implicitly or explicitly on, it's usually wrong. In this case, it should (probably) be **/node_modules/**/*. For example, check out https://github.com/IBM/report-toolkit/pull/44/files

What I'm suggesting is to harden exclude to always contain the following paths regardless of whether exclude is set.

  • **/node_modules/**/*
  • .*/**

To disable this, users will have to turn off a setting like enableImplicitExcludePatterns.

主要語言
Go
星號
111k
分支
14.4k
平均合併
1 天 19 小時
30 天內合併 PR
117

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microsoft/TypeScript 的其他 Issue

查看 microsoft/TypeScript 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。