Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ratchet unicorn/no-global-object-property-assignment to error (off in tests)#283

Merged
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-no-global-assign
Jun 22, 2026
Merged

Ratchet unicorn/no-global-object-property-assignment to error (off in tests)#283
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-no-global-assign

Conversation

@twschiller

Copy link
Copy Markdown
Contributor

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.js only)

  • Removed from the warn list → reverts to the unicorn/recommended default (error).
  • Added "unicorn/no-global-object-property-assignment": "off" to the src/**/__tests__/** override block.

Verification

  • No production code violates the rule — 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 check exit 0
  • bun run test — 2059/2059 pass

Refs #279

… 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]>
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-browser-shield-demo-site Ready Ready Preview, Comment Jun 22, 2026 11:34am

Request Review

@twschiller twschiller merged commit 2be238c into main Jun 22, 2026
7 checks passed
@twschiller twschiller deleted the ratchet-unicorn-no-global-assign branch June 22, 2026 11:36
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