microsoft / microsoft/TypeScript
Files outside rootDir emit files adjacent to themselves if they are imported by an included file
Personne n'a encore pris cette issue.
- Langage dominant
- Go
- Étoiles
- 111k
- Forks
- 14.4k
- Merge moyen
- 1 j 19 h
- PR mergées (30 j)
- 117
Description
Bug Report
The documentation for rootDir states that
Note that TypeScript will never write an output file to a directory outside of outDir, and will never skip emitting a file. For this reason, rootDir also enforces that all files which need to be emitted are underneath the rootDir path.
If any included file imports a ts file outside of rootDir, a declaration file is generated for that imported file and emitted adjacent to it. noEmitOnError needs to be either omitted or set to false, or the -b flag needs to be specified for this to occur.
🔎 Search Terms
noEmitOnError, unwanted declaration files, emits outside outDir, emits outside declarationDir
🕗 Version & Regression Information
On all versions matching ^4.2.4 and on the current nightly, nonexhaustive, haven't checked others
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about tsconfig.json behaviour and commandline behaviour
⏯ Playground Link
https://github.com/gtm-nayan/ts-no-emit-wat/
Sorry, couldn't figure out multiple files in the playground or the workbench.
💻 Code
🙁 Actual behavior
Declaration files emitted outside of output directory.
🙂 Expected behavior
No files should be emitted outside of the specified output directory.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par reproduire le comportement dans le dépôt lié, en vous concentrant sur un fichier situé en dehors de rootDir qui est importé par un fichier inclus, ainsi que sur l'émission de déclarations qui en résulte. Suivez ensuite la gestion de rootDir, outDir, declarationDir et noEmitOnError par le compilateur TypeScript ; le travail est terminé lorsqu'aucun fichier de déclaration n'est émis en dehors du répertoire de sortie configuré.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- typescript
- Domaine
- compilers
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100