Skip to content

Extend no-unnecessary-global-this test exclusion to __test-mocks__#293

Merged
twschiller merged 1 commit into
mainfrom
ratchet-global-this-test-mocks
Jun 22, 2026
Merged

Extend no-unnecessary-global-this test exclusion to __test-mocks__#293
twschiller merged 1 commit into
mainfrom
ratchet-global-this-test-mocks

Conversation

@twschiller

Copy link
Copy Markdown
Contributor

Follow-up to #292.

#292 disabled unicorn/no-unnecessary-global-this for src/**/__tests__/**, but __test-mocks__ is also test infrastructure (loaded via Jest setupFiles) that deliberately uses globalThis.* — e.g. globalThis.chrome.scripting = … to install the MV3 scripting mock the lib's types omit.

Changes

  • eslint.config.js: add src/__test-mocks__/**/*.{ts,tsx} to the test-files override (the same grouping tsconfig.test.json already uses for these files).
  • chrome-mv3-extras.ts: drop the now-redundant inline eslint-disable (the rule no longer applies there).

Verification

  • bun run check exit 0 (no violations, no unused-disable warnings)
  • bun run test — 2059/2059 pass

Refs #279

Follow-up to #292. The test-files override disabled the rule for
`src/**/__tests__/**`, but `__test-mocks__` is also test infrastructure that
deliberately uses `globalThis.*` (e.g. `globalThis.chrome.scripting = …` to
install the MV3 scripting mock). Add `src/__test-mocks__/**` to that override
— the same grouping tsconfig.test.json already uses — and drop the now-
redundant inline disable in chrome-mv3-extras.ts.

Refs #279

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@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 1:53pm

Request Review

@twschiller twschiller merged commit 7fffe7b into main Jun 22, 2026
7 checks passed
@twschiller twschiller deleted the ratchet-global-this-test-mocks branch June 22, 2026 13:55
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