microsoft / microsoft/TypeScript
Investigate implicit excludes
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo la struttura del monorepo .js descritta nell’issue, confrontando il comportamento con e senza jsconfig.json e con un exclude esplicito. Verifica come il comportamento attuale di exclude implicito gestisce sia le posizioni di node_modules sia i file nascosti. Il lavoro è completato quando viene stabilito un approccio condiviso per applicare o disabilitare i pattern proposti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100