microsoft / microsoft/TypeScript

Investigate implicit excludes

オープン
#35,121 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Domain: Performance
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、issue に記載された .js モノレポのレイアウトを再現し、jsconfig.json がある場合とない場合、および明示的な exclude を指定した場合の動作を比較します。現在の暗黙的な exclude の動作が、node_modules の両方の場所とドットファイルをどのように扱うかを調査します。提案されたパターンを適用または無効化するための合意されたアプローチを確立できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
compilers
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。