microsoft / microsoft/TypeScript

Allow for dropping tsconfig.json in arbitrary folder and specifying the source root with tsc command

Abierto
#27,386 5 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Awaiting More Feedback Suggestion
Lenguaje dominante
Go
Estrellas
111k
Forks
14.3k
Merge medio
2 d 4 h
PR fusionados (30 d)
132

Descripción

Search Terms

  1. tsconfig.json
  2. TS18003
  3. project root

Suggestion

I have been deving an automation publish tool, with typescript inside. Nice work for you!

Since the tsconfig.json file need to be put in a center config folder other than project/source code root. amd i have tried to use tsc --watch --project path-to-tsconfig.json to make this future, which is not working for now.

I got TS18003 error, and i know why this happen: tsc just want to remind us we may have a wrong include or exclude config. 😄 I cannot find any tsc command should i use to conject with --project option to specify the project root.

I find in the tsc sourcecode that the compiler.parseJsonConfigFileContent(_, _, basePath); function could let us specify the project basePath when parsing tsconfig.json, so, i want to ask if we can expose a command option to let use the same function as basePath, maybe --configFileBasePath or --configContext?

Please let me know if there already is a solution for my use case.

Thank you for your works!

Examples

tsc --project path-to-tsconfig.json --configContext path-to-source-code-root

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript / JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. new expression-level syntax)

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con el manejo de tsc --project y la llamada a compiler.parseJsonConfigFileContent mencionada en el issue. Traza cómo las rutas de tsconfig.json determinan la ruta base del proyecto y cómo se produce TS18003. Se considera terminado cuando una opción de comando documentada puede especificar una raíz de código fuente independiente para una configuración en una carpeta arbitraria, con pruebas que cubran la invocación de ejemplo.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
build-system, cli
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.