Extend no-unnecessary-global-this test exclusion to __test-mocks__#293
Merged
Conversation
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>
|
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.
Follow-up to #292.
#292 disabled
unicorn/no-unnecessary-global-thisforsrc/**/__tests__/**, but__test-mocks__is also test infrastructure (loaded via JestsetupFiles) that deliberately usesglobalThis.*— e.g.globalThis.chrome.scripting = …to install the MV3 scripting mock the lib's types omit.Changes
eslint.config.js: addsrc/__test-mocks__/**/*.{ts,tsx}to the test-files override (the same groupingtsconfig.test.jsonalready uses for these files).chrome-mv3-extras.ts: drop the now-redundant inlineeslint-disable(the rule no longer applies there).Verification
bun run checkexit 0 (no violations, no unused-disable warnings)bun run test— 2059/2059 passRefs #279