microsoft / microsoft/TypeScript
Move away from Classic module resolution as default for all module kinds
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript's original module resolution strategy (the Classic resolution strategy) has some strange behavior that apparently doesn't actually reflect any other resolution strategy. It seems strange that those using non-CommonJS emit targets get this behavior by default.
Classic resolution also causes many disk probes during the walk up the project root - assuming that this strategy does eventually succeed in most cases, it seems like most uses could be subsumed by:
- Using relative paths.
- Modifying the
baseUrlandpathsproperties intsconfig.json.
After discussing with @vladima, we think it is worth considering switching the default resolution strategy for all module targets to Node.
Here's what needs to be done:
- Investigate existing
tsconfig.jsons that target esXXXX` and have no explicit/implied resolution strategy. - Determine the downstream effects to a change to defaults
- Determine if this change outweighs the potential breakage
- Implement if appropriate
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 by investigating existing tsconfig.json files targeting esXXXX without an explicit or implied resolution strategy. Compare the downstream effects and potential breakage of changing the default from Classic to Node, then determine whether implementation is appropriate. Done means a supported decision and, if approved, the default behavior is implemented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100