docs: say where the Worker-isomorphism ban is actually defined - #807
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Conventions entry said the Node-builtin ban is "enforced per-package via an ESLint
no-restricted-imports/no-restricted-globalsrule". 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 fromnode:module'sbuiltinModulesrather than restating it, and is opted into withisomorphic: trueonpackageLintConfig.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-importsswitches the isomorphism ban back off while still reporting itself as working. Deriving frombuiltinModulesalso matters on its own — the hand-written list this replaced was eighteen names, leavingdns,cluster,tls,vm,v8andreplunguarded.CLAUDE.mdandAGENTS.mdare symlinks toREADME.md, so the target is edited and all three read the corrected text. Docs only, no behaviour change.