build: migrate deprecated moduleResolution node to modern equivalents - #5202
build: migrate deprecated moduleResolution node to modern equivalents#5202robert-md-or wants to merge 1 commit into
Conversation
Verification Guide for ReviewersWhy two different target values (
I tested both directions before deciding per file:
How I verified each file:
Left untouched: |
|
After merging your previous PR, this one has conflicts. |
|
Thanks @markostanimirovic, I'm already on it. I think the conflict happened because my previous PR modified the same tsconfig/config files (or the surrounding configs) that this change touches, so merging it changed the base branch and now this branch can't be fast-forwarded cleanly. I'm already on it, I'll rebase/merge the latest main into this branch, resolve the conflicts (keeping the intended moduleResolution changes), run |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Several
tsconfig.jsonfiles across the workspace setmoduleResolution: "node", which TypeScript has marked for removal as part of thetarget/moduleResolutiondeprecation cleanup tracked in #5163. Left as-is, these configswill start failing once the workspace upgrades to a TypeScript version
where the value is removed.
What is the new behavior?
Migrates
moduleResolution: "node"away from the 5 affected tsconfigfiles:
projects/www/src/app/examples/__base/tsconfig.json: already usedmodule: "ES2022", somoduleResolutionmoved directly to"bundler".tsconfig.docs.json,modules/schematics/tsconfig.build.json,modules/eslint-plugin/tsconfig.schematics.json,modules/eslint-plugin/spec/fixtures/tsconfig.json: these use (ordefault to)
module: "commonjs"for code executed directly via Node(schematics, docs generation, test fixtures). Migrating these to
"bundler"or"nodenext"surfaced unrelated pre-existing typeerrors or ECMAScript import-extension requirements incompatible with
the current dependency graph. Moved
moduleResolutionto"node10"instead — TypeScript's renamed, non-deprecated equivalent of the old
"node"behavior, with no change in resolution semantics.One file from the original scope,
modules/store/spec/ngc/tsconfig.ngc.json, is intentionally leftuntouched: it isn't referenced by any Nx target and appears to be dead
code left over from an old ngc/Ivy AOT compiler test setup. Left for
maintainers to decide whether to fix or remove.
Verified with:
tsc --noEmitontsconfig.docs.json,modules/schematics/tsconfig.build.json, andmodules/eslint-plugin/tsconfig.schematics.json(no new errorsintroduced versus the pre-existing baseline)
pnpm nx run eslint-plugin:test(78 test files, 554 tests, 0 typeerrors)
This PR addresses the
moduleResolutionportion of the broader scopeoutlined in #5163. Remaining categories from that issue
(the one remaining
target: "ES5"config, andbaseUrl/rootDir) arebeing tracked separately and are not part of this PR.
Does this PR introduce a breaking change?
Other information
Related to #5163 (partial — see scope note above; not marked as closing
since further work from that issue is still in progress).