microsoft / microsoft/TypeScript
Document File name has a '.js' extension - stripping it
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der im Issue verlinkten Handbuchseite zur Modulauflösung und vergleiche ihre aktuelle Erklärung mit der traceResolution-Ausgabe für die .js- und .jsx-Beispiele. Dokumentiere, welche Erweiterungen entfernt werden und welche Lookups anschließend erfolgen, und überprüfe dann, dass die Seite beide Fragen beantwortet, ohne das Compilerverhalten zu ändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- documentation
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 68/100