Skip to content

FIB-51490: Scope testing-library plugin to test files only#931

Merged
agierloff88 merged 1 commit into
developfrom
FIB-51490-scope-testing-library-to-test-files
Jun 10, 2026
Merged

FIB-51490: Scope testing-library plugin to test files only#931
agierloff88 merged 1 commit into
developfrom
FIB-51490-scope-testing-library-to-test-files

Conversation

@agierloff88

@agierloff88 agierloff88 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

@fishbrain/eslint-config-react applied eslint-plugin-testing-library's flat/react preset with no files restriction, so it linted the entire codebase — not just tests. That produces false positives in source, e.g. our own logger.debug(...) flagged by testing-library/no-debugging-utils as if it were screen.debug().

This scopes the plugin to test files only, following the plugin's official recommendation:

const testingConfig = [
  {
    files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
    ...testingLibraryPlugin.configs['flat/react'],
  },
];

Version bumped 6.3.6 → 6.3.7 (all three package.json files, per the repo's lockstep convention).

Verification

calculateConfigForFile confirms testing-library/* rules are now active only on test files:

File no-debugging-utils
src/foo.ts NOT ACTIVE
src/foo.test.tsx active (warn)
src/__tests__/bar.ts active (warn)

Workspace tests pass (yarn workspaces foreach --all run test).

Downstream

Once 6.3.7 is published, consumers ("mykiss and friends") can bump and will lose the false positives. In mykiss-web specifically this also unblocks removing the testing-library/render-result-naming-convention: 'off' workaround (whose comment cites this exact "plugin runs against all files" limitation).

Part of FIB-35810FIB-51490.

🤖 Generated with Claude Code

The flat/react config applied eslint-plugin-testing-library with no files
restriction, so it linted all source and produced false positives (e.g.
logger.debug() flagged as screen.debug()). Restrict it to test-file globs
per the plugin's recommendation.

Bump 6.3.6 -> 6.3.7.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@agierloff88 agierloff88 requested a review from a team as a code owner June 10, 2026 08:20
@agierloff88 agierloff88 requested review from alexanderbergstrom-fishbrain, lhansford and pedro-belem and removed request for a team and pedro-belem June 10, 2026 08:20

@lhansford lhansford left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this 🙏

@agierloff88

Copy link
Copy Markdown
Contributor Author

@lhansford whats the workflow on bumping versions here? I see in other prs the versions have not been bumped. Should we add something to the readme so claude also know the workflow?

@lhansford

Copy link
Copy Markdown
Collaborator

@lhansford whats the workflow on bumping versions here? I see in other prs the versions have not been bumped. Should we add something to the readme so claude also know the workflow?

We're just cutting release manually when we want to. There's instructions in the readme

@agierloff88

Copy link
Copy Markdown
Contributor Author

got it thanks

@agierloff88 agierloff88 merged commit 9b65daa into develop Jun 10, 2026
3 checks passed
@agierloff88 agierloff88 deleted the FIB-51490-scope-testing-library-to-test-files branch June 10, 2026 08:32
@FishbrainAPIMachineUser FishbrainAPIMachineUser mentioned this pull request Jun 10, 2026
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.

2 participants