microsoft / microsoft/TypeScript

compilerOptions.plugins is not inherited through tsconfig "extends"

Abierto
#63,975 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

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

Descripción

🔎 Search Terms

extends plugins, compilerOptions.plugins extends, plugins not inherited, tsconfig extends inheritance, showConfig plugins

🕗 Version & Regression Information
⏯ Playground Link

No response

💻 Code

tsconfig.base.json:

{ "compilerOptions": { "plugins": [{ "name": "my-plugin" }] } }

tsconfig.json:

{ "extends": "./tsconfig.base.json", "compilerOptions": { "module": "nodenext" } }

Then run tsc -p . --showConfig

🙁 Actual behavior

compilerOptions.plugins is absent from the resulting config. A plugins array declared only in a base config never reaches ParsedCommandLine.Raw, it survives only if the leaf tsconfig redeclares it.

🙂 Expected behavior

plugins is inherited from the base config, as with any other compilerOptions entry the child doesn't override (6.0.3 behaviour).

Additional information about the issue
Cause

plugins is the only declared compiler option with no field on core.CompilerOptions, it's carried purely as raw JSON. So mergeCompilerOptions never brings it across, and applyExtendedConfig's raw-JSON merge only handles include/exclude/files/contentMappers/compileOnSave.

Possibly related

root-level watchOptions looks like the same issue.

Fix

I have a fix with tests ready and am happy to open a PR.

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

Empieza por mergeCompilerOptions y applyExtendedConfig, siguiendo cómo compilerOptions.plugins llega a ParsedCommandLine.Raw. Reproduce el caso con tsc -p . --showConfig y añade después cobertura de regresión que muestre que plugins de un tsconfig extendido aparece en la configuración resultante sin volver a declararse.

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
3/5
Tiempo estimado
1-2 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
65/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.