Skip to content

docs: say where the Worker-isomorphism ban is actually defined - #807

Merged
Mearman merged 1 commit into
mainfrom
docs-isomorphism-shared-config
Aug 25, 2026
Merged

docs: say where the Worker-isomorphism ban is actually defined#807
Mearman merged 1 commit into
mainfrom
docs-isomorphism-shared-config

Conversation

@Mearman

@Mearman Mearman commented Aug 25, 2026

Copy link
Copy Markdown
Member

The Conventions entry said the Node-builtin ban is "enforced per-package via an ESLint no-restricted-imports/no-restricted-globals rule". Defensible — enforcement does happen in each package's own lint run — but it reads as though each package declares the rule, which is the same misconception just removed from CONTRIBUTING.md's add-a-package steps.

Reworded to say the ban is defined once in eslint.shared.ts, derives its module list from node:module's builtinModules rather than restating it, and is opted into with isomorphic: true on packageLintConfig.

Why the distinction is worth the words rather than left implicit: hand-writing the rule looks equivalent and isn't. Flat config replaces a same-key rule rather than merging it, so a second no-restricted-imports switches the isomorphism ban back off while still reporting itself as working. Deriving from builtinModules also matters on its own — the hand-written list this replaced was eighteen names, leaving dns, cluster, tls, vm, v8 and repl unguarded.

CLAUDE.md and AGENTS.md are symlinks to README.md, so the target is edited and all three read the corrected text. Docs only, no behaviour change.

The Conventions entry described the ban as enforced per-package via an ESLint
rule, which reads as though each package declares it.
Each package opts in with one flag instead, and the rule itself lives once in
eslint.shared.ts, deriving its module list from node:module's builtinModules.

The distinction matters to anyone adding a package: writing the rule by hand
looks equivalent and is not, since flat config replaces a same-key rule rather
than merging it, so a second no-restricted-imports switches the ban off while
still reporting itself as working.
@Mearman
Mearman marked this pull request as ready for review August 25, 2026 09:24
@Mearman
Mearman merged commit d540d5a into main Aug 25, 2026
15 checks passed
@Mearman
Mearman deleted the docs-isomorphism-shared-config branch August 25, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant