π 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
π 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
modulevalues imply and enforce certainmoduleResolutionvalues as decribed at https://www.typescriptlang.org/docs/handbook/modules/reference.html#implied-and-enforced-optionsHowever the following
tsconfigworks 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 nodenextshould enforce--moduleResolution nodenextπ Actual behavior
the
tsccompilation 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