enable-node-typescript-globals: Enable Node.js ambient types in the base TypeScript config #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/enable-node-typescript-globals"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Assigned idea
tsconfig.base.json explicitly sets "types": [], which disables all ambient @types packages and can lead to missing globals like Buffer, process, and NodeJS.* across the codebase. Update the base config to include Node’s ambient types so Node-targeted packages compile cleanly without per-package workarounds.
Approach: 1) Edit tsconfig.base.json and replace the current compilerOptions "types": [] with "types": ["node"].
2) Keep all other compilerOptions unchanged to minimize behavior changes.
3) If any package intentionally must not see Node globals, it can override "types" in its own tsconfig (leave that to follow-up work if it exists).
Verification: Run
npx tsc -p tsconfig.base.json --showConfigand confirm the resolved config includes"types": ["node"](and no longer shows an empty types array) coming from tsconfig.base.json.Risk: Adding Node ambient types can introduce or surface global type conflicts (e.g., if some parts of the repo expect a non-Node environment), and may change how certain identifiers are typed. Keeping the change scoped to the base config means any environment-specific projects may need to explicitly override "types".
Agent context
Task slug: enable-node-typescript-globals
Branch: task/enable-node-typescript-globals
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.