microsoft / microsoft/TypeScript
Module value in TSConfig does not enforce ModuleResolution value
@andrewbranch arbeitet bereits daran.
Seit 27.7.2026.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
🔎 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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.