microsoft / microsoft/TypeScript
How tsconfig exclude pattern should actually work
Open
Nobody has claimed this yet.
Help Wanted
Suggestion
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 2.1.1 / nightly (2.2.0-dev.201xxxxx)
Say we have a following structure to specially to test exclude pattern:
/node_modules
/module/some.ts
nested/
/node_modules
/module/some.ts
/deep-nested/
/node_modules
/module/some.ts
Will check this using tsc --listFiles
How exclude patterns work:
- "node_modules" - will exclude only
/node_modules/module/some.ts - "*/node_modules" (the same effect as /node_modules/") - will exclude only
/nested/node_modules/module/some.ts - "**/node_modules" - will exclude nothing
- "**/node_modules/*" - will exclude everything (also nested, deep-nested)
Some behaviour seem strange to me
- why in case 3 it excludes nothing (considering case 2 works)?
- by default (if
excludenot specified) case 1 will be effective, shouldn't it be 4) which excludesnode_modulesin nested folders as well?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported tsc --listFiles command and reproduce the listed directory structure using the four exclude patterns. Trace the compiler's exclude-pattern handling to determine why the patterns select different directories, then add or update coverage for the observed cases and verify the intended behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100