microsoft / microsoft/TypeScript
Files outside rootDir emit files adjacent to themselves if they are imported by an included file
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.4k
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 117
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza reproduciendo el comportamiento en el repositorio enlazado, centrándote en un archivo fuera de rootDir que es importado por un archivo incluido y en la emisión de declaraciones resultante. Después, sigue el tratamiento de rootDir, outDir, declarationDir y noEmitOnError por parte del compilador de TypeScript; se considera terminado cuando no se emiten archivos de declaración fuera del directorio de salida configurado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- compilers
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100