microsoft / microsoft/TypeScript

Support finding a `jsconfig.json` with `tsc -p .`

Abierto
#41,350 3 comentarios 18 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Awaiting More Feedback Suggestion
Lenguaje dominante
Go
Estrellas
111k
Forks
14.4k
Merge medio
1 d 19 h
PR fusionados (30 d)
117

Descripción

Search Terms

jsconfig project

Suggestion

When I run tsc -p . on a JavaScript project with jsconfig.json and // @ts-check with JSDoc it complains about not finding a tsconfig.json

Currently I have to run tsc -p jsconfig.json --maxNodeModuleJsDepth 0 to check my JavaScript project.

~/projects/sync-wait-group on master*
$ tsc -p .
error TS5057: Cannot find a tsconfig.json file at the specified directory: '.'.

It tells me that tsconfig.json does not exist.

Adding detection for jsconfig.json and turning --maxNodeModuleJsDepth 0 on by default ( which we do for tsconfig.json but not jsconfig.json ) would be a good user experience improvmenent.

Use Cases

Being able to use the tsc cli on a JavaScript + JSDoc project.

Examples

tsc -p . will "just work" for a JavaScript project.

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. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

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 reproduciendo el comportamiento informado de tsc -p . en un proyecto JavaScript que contenga jsconfig.json y // @ts-check con JSDoc. Traza cómo la CLI de tsc resuelve la configuración del proyecto y aplica maxNodeModuleJsDepth; se considera terminado cuando tsc -p . descubre jsconfig.json y utiliza el valor predeterminado previsto sin requerir flags explícitos.

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

Evaluación

Stack tecnológico
javascript, typescript
Área
cli, compilers
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.