Skip to content

Proposal: enable no-node-globals and no-process-global lint rules #7251

Description

@tomas-zijdemans

I propose adding no-node-globals and no-process-global to the lint config. Both rules pass on the current codebase with zero violations, so enabling them is a one-line config change. This issue is the ask for a green light before I open that PR.

Why lint for something type checking should catch

A bare process or Buffer reference breaks browsers and non-Node runtimes, and today nothing reliably stops one from landing:

  • The repo depends on npm packages (fast-check, node-graphviz, typescript). Any of them can pull @types/node into the type graph, and from that point a bare process type-checks silently, everywhere.
  • _tools/check_browser_compat.ts type-checks against a browser tsconfig, but it skips tests and _-prefixed internal files by design.
    So the gap is real even though the codebase is clean right now. A lint rule closes it for every file, every PR, with no reliance on what happens to be in the type graph that day.

Cost

None today. Zero violations, no ignores needed, no code churn. Contributors touching Node-specific code keep doing what the codebase already does: import from node:process and friends explicitly.

Possibly in the same PR: ban-untagged-todo

The style guide already requires TODOs to carry a username or issue link. The rule enforcing that is off, and 5 untagged TODOs have accumulated (csv/parse.ts, csv/parse_stream.ts, dotenv/mod_test.ts, testing/_snapshot_utils.ts, toml/_test_utils.ts). Happy to fix those and enable the rule in the same PR, or drop this part if you'd rather keep the PR single-purpose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions