microsoft / microsoft/TypeScript
Module value in TSConfig does not enforce ModuleResolution value
@andrewbranch ya está trabajando en esto.
Desde el 27/7/2026.
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.3k
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 132
Descripción
🔎 Search Terms
moduleresolution enforce
🕗 Version & Regression Information
I tested also on typescript 5 and the behavior was the same
⏯ Playground Link
No response
💻 Code
According to docs certain module values imply and enforce certain moduleResolution values as decribed at https://www.typescriptlang.org/docs/handbook/modules/reference.html#implied-and-enforced-options
However the following tsconfig works without any issue:
{
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "node16", // this should not be allowed
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"strict": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"types": ["*"]
}
}
even when according to docs --module nodenext should enforce --moduleResolution nodenext
🙁 Actual behavior
the tsc compilation works with option that should fail according to docs
🙂 Expected behavior
fix the behavior or the docs
Additional information about the issue
typescript version: 6.0.3
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.
Evaluación
Este issue todavía no se ha evaluado.