microsoft / microsoft/TypeScript
Module value in TSConfig does not enforce ModuleResolution value
@andrewbranch is already working on this.
Since Jul 27, 2026.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
### 🔎 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:
```json
{
"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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.