Ratchet unicorn/no-global-object-property-assignment to error (off in tests)#283
Merged
Merged
Conversation
… tests) Fourth ratchet from #279. All flagged sites were in test files, which legitimately assign onto globals to install mocks. Rather than keep the rule a blanket warning, enforce it as error for production code and disable it only in the test-files override block. - eslint.config.js: drop from the warn list (reverts to recommended error); add "off" to the `src/**/__tests__/**` block. No production code currently violates it (verified, including the __test-mocks__ tree, which the rule doesn't flag). Refs #279 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Fourth ratchet from #279.
All 6 flagged sites were in test files (
subtree-watcher.test.ts,hidden-fee-annotate.test.ts), which legitimately assign onto globals to set up mocks. So instead of keeping it a blanket warning, this enforces it as error for production code and disables it only in tests.Changes (
eslint.config.jsonly)error)."unicorn/no-global-object-property-assignment": "off"to thesrc/**/__tests__/**override block.Verification
eslint .reports 0 errors for it, including the__test-mocks__tree (which the glob doesn't cover but the rule doesn't flag).bun run checkexit 0bun run test— 2059/2059 passRefs #279