Document File name has a '.js' extension - stripping it
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- documentation
Research direction
Start with the module-resolution handbook page linked in the issue and compare its current explanation with the traceResolution output for the .js and .jsx examples. Document which extensions are stripped and which lookups follow, then verify that the page answers both questions without changing the compiler behavior.
Written by the indexing model from the issue text.
Description
TypeScript Version: 4.2.0-dev.20201211
Search Terms: typescript File name has a '.js' extension - stripping it
Code
https://github.com/sguillia/ts-repro-III
other.ts
import * as index from "./index.js"
index.ts
export { }
Compile with:
tsc other.ts --traceResolution
Expected behavior:
Does not compile?
Actual behavior:
$ tsc other.ts --traceResolution
...
File name '/path/to/ts-repro-III/index.js' has a '.js' extension - stripping it.
...
This document is very good:
https://www.typescriptlang.org/docs/handbook/module-resolution.html
But it doesn't talk about resolution of modules with their extensions.
The actual behavior is fine but I did not manage to find its documentation
Same issue for jsx
$ tsc other.ts --traceResolution
...
File name '/path/to/ts-repro-III/index.jsx' has a '.jsx' extension - stripping it.
...
Would it be possible to document
- which extension are trimmed?
- what look-ups are performed based on the file name with extension stripped?
Playground Link: https://github.com/sguillia/ts-repro-III
Related Issues: no
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 106
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.
More from microsoft/TypeScript
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
microsoft/TypeScript#64322 · 2 comments · 1 reaction · 2 assignees ·
-
Possible Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/TypeScript#64278 · 1 comment · 1 reaction ·
-
Docs
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microsoft/TypeScript#64118 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
microsoft/TypeScript#64094 ·
-
Docs
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/TypeScript#63959 · 5 comments ·
All issues in microsoft/TypeScript
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100