microsoft / microsoft/TypeScript
Tsconfig option to disable .tsx extension lookup in module resolution
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
Suggestion
Running tsc --traceResolution in my project I found that Typescript was looking up .tsx files for every module resolution. That's very inconvenient, first because .tsx extension serves a very specific domain, second because by elliminating hundreds or maybe thousands of (think of a really big project) unecessary stat() syscalls the build time would probably speed up a bit, or maybe considerably.
🔍 Search Terms
- tsx
- module resolution
✅ Viability Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
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 tsc --traceResolution to observe the current module-resolution probes for .tsx files. Trace the module-resolution entry points and determine how a tsconfig option would control those probes without changing existing defaults. Done means the option suppresses .tsx lookup when enabled while normal resolution remains unchanged otherwise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100