GeezerVison is showing github.com — fix(lint): no-test-in-loop catches .each suites declared inside a loop by only21mil · Pull Request #32793 · pingdotgg/t3code
Conversation
only21mil
commented
Nov 8, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem
t3code/no-test-in-loop (#14921) reports it(...), it.effect(...) and describe(...) inside a for loop, but not a parameterized suite declared in a loop: it.each(cases)(...), describe.each(cases)(...) or it.effect.each(cases)(...). Two files on main register one .each suite per loop iteration and pass lint: BitbucketPullRequestProvider.test.ts:72 and elicitationForm.test.ts:7.
Change
- The rule also reports a call whose callee is
<T>.each(cases), where <T> is a name it already accepts (describe, it, suite, test, or <T>.effect / <T>.live). It reuses testCallName instead of walking any member chain. A loop variable named test (as in provider-pi/src/server/adapter.test.ts) is not flagged. It reports once, on the outer call: Do not call it.each(…)(…) inside a for loop. Fold the loop into one it.each(cases) list instead.
skip, only, todo, skipIf and runIf chains are unchanged. On @effect/vitest's it.effect and it.live they return a test with no .each, and no-test-timeout-or-unreasoned-skip already covers skip and only. A valid row records this.
- The 2 sites now fold their loop value into the case list (
flatMap) and title it with $operation / $variant / $type. Test names are unchanged: verbose-reporter name lists before and after are identical (Bitbucket 19, elicitationForm 6). The test bodies are only re-indented (git diff -w shows 14 changed lines per file).
- Rule tests: 3 invalid rows (
it.each, describe.each reported once, it.effect.each) and 2 valid rows (it.effect.skipIf in a loop, loop variable named test).
Scope and approval
A focused lint fix with no runtime change. It closes a gap in a rule a maintainer added (#14921), using that rule's own remedy, and migrates the only 2 sites the fixed rule reports. There is no issue for it: the gap was found by running the rule's own harness against loop-registered .each forms, and the fix is small enough to review directly.
Verification
Runs on main eceeab4 and on this branch 5ca66c3 merged locally with it (74b3a0dfba, not pushed; clean merge, the 4 changed files byte-identical to 5ca66c3). "Before" runs bind this branch's rule or rule test file read-only over main's copy. Output below is unedited; lint exit is the status of vp lint.
- Rule tests: main's rule fails the 3 new invalid rows, 10 passed. The merged tree passes 13/13.
vp lint over all 2054 tracked test files on main: 0 no-test-in-loop diagnostics. This branch's rule on main's files flags exactly the 2 sites, BitbucketPullRequestProvider.test.ts:72 and elicitationForm.test.ts:7, and nothing in provider-pi. The merged tree: 0.
- Both migrated files on main and the merged tree: 19 and 6 passed, identical test names.
- CI on 5ca66c3 is green.
Not checked: full test suites on the merged tree (CI runs them).
Run output: rule tests and repo-wide lint, before and after
Before: main's rule against this branch's rule tests (3 failed, 10 passed).
$ vp test run --config ../vite.config.ts --dir . --reporter=verbose rules/no-test-in-loop.test.ts
note: You are running `vp test` as a Vite+ built-in command. If you meant to run the test npm script, use `vpr test` instead.
RUN v5.0.5 /mnt/t3code/oxlint-plugin-t3code
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > allows it.each and it.effect.each > passes 449ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > allows loops inside a test body > passes 457ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > ignores node:test files, which have no .each > passes 358ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > allows it.effect.skipIf inside a loop, which has no .each > passes 262ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > ignores member calls on a loop variable named test > passes 316ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it inside a for...of loop > reports the rule diagnostic 327ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it.effect inside a for loop nested in describe > reports the rule diagnostic 231ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports test inside a for...in loop > reports the rule diagnostic 392ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports a describe inside a loop once, not the tests inside it > reports the rule diagnostic 244ms
stdout | rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it.each inside a for...of loop > reports the rule diagnostic
[22:25:15.562] ERROR (#217): OxlintFixtureExpectedFailure: Expected oxlint to report a failure for rule t3code/no-test-in-loop, but it passed.
at Object.onSuccess (/mnt/t3code/oxlint-plugin-t3code/test/utils.ts:149:38) {
_tag: 'OxlintFixtureExpectedFailure',
ruleName: 't3code/no-test-in-loop',
[cause]: undefined
}
× rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it.each inside a for...of loop > reports the rule diagnostic 209ms
→ Expected oxlint to report a failure for rule t3code/no-test-in-loop, but it passed.
stdout | rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports a describe.each inside a loop once > reports the rule diagnostic
[22:25:15.776] ERROR (#236): OxlintFixtureExpectedFailure: Expected oxlint to report a failure for rule t3code/no-test-in-loop, but it passed.
at Object.onSuccess (/mnt/t3code/oxlint-plugin-t3code/test/utils.ts:149:38) {
_tag: 'OxlintFixtureExpectedFailure',
ruleName: 't3code/no-test-in-loop',
[cause]: undefined
}
× rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports a describe.each inside a loop once > reports the rule diagnostic 213ms
→ Expected oxlint to report a failure for rule t3code/no-test-in-loop, but it passed.
stdout | rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it.effect.each inside a for loop > reports the rule diagnostic
[22:25:15.985] ERROR (#255): OxlintFixtureExpectedFailure: Expected oxlint to report a failure for rule t3code/no-test-in-loop, but it passed.
at Object.onSuccess (/mnt/t3code/oxlint-plugin-t3code/test/utils.ts:149:38) {
_tag: 'OxlintFixtureExpectedFailure',
ruleName: 't3code/no-test-in-loop',
[cause]: undefined
}
× rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it.effect.each inside a for loop > reports the rule diagnostic 208ms
→ Expected oxlint to report a failure for rule t3code/no-test-in-loop, but it passed.
✓ rules/no-test-in-loop.test.ts > ignores non-test files > passes 202ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 3 ⎯⎯⎯⎯⎯⎯⎯
FAIL rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it.each inside a for...of loop > reports the rule diagnostic
FAIL rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports a describe.each inside a loop once > reports the rule diagnostic
FAIL rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it.effect.each inside a for loop > reports the rule diagnostic
OxlintFixtureExpectedFailure: Expected oxlint to report a failure for rule t3code/no-test-in-loop, but it passed.
❯ Object.onSuccess test/utils.ts:149:38
147| )
148| : Effect.fail(error),
149| onSuccess: () => Effect.fail(new OxlintFixtureExpectedFailure(…
| ^
150| }),
151| );
❯ OnSuccessAndFailureImpl.~effect/Effect/successCont ../node_modules/.pnpm/[email protected]/node_modules/effect/src/internal/effect.ts:3635:58
❯ ~effect/Effect/evaluate ../node_modules/.pnpm/[email protected]/node_modules/effect/src/internal/core.ts:587:30
❯ FiberImpl.runLoop ../node_modules/.pnpm/[email protected]/node_modules/effect/src/internal/effect.ts:700:41
❯ FiberImpl.evaluate ../node_modules/.pnpm/[email protected]/node_modules/effect/src/internal/effect.ts:635:23
❯ FiberImpl.evaluate ../node_modules/.pnpm/[email protected]/node_modules/effect/src/internal/effect.ts:624:29
❯ ../node_modules/.pnpm/[email protected]/node_modules/effect/src/internal/effect.ts:1210:17
❯ ../node_modules/.pnpm/[email protected]/node_modules/effect/src/Effect.ts:27179:13
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { _tag: 'OxlintFixtureExpectedFailure', ruleName: 't3code/no-test-in-loop' }
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯
Test Files 1 failed (1)
Tests 3 failed | 10 passed (13)
Start at 22:25:12
Duration 4.17s (tests 95%, setup 2%, transform 1%, import 1%)
exit=1
After: rule tests on the merged tree (13 passed).
$ vp test run --config ../vite.config.ts --dir . --reporter=verbose rules/no-test-in-loop.test.ts
note: You are running `vp test` as a Vite+ built-in command. If you meant to run the test npm script, use `vpr test` instead.
RUN v5.0.5 /mnt/t3code/oxlint-plugin-t3code
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > allows it.each and it.effect.each > passes 418ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > allows loops inside a test body > passes 468ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > ignores node:test files, which have no .each > passes 450ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > allows it.effect.skipIf inside a loop, which has no .each > passes 389ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > ignores member calls on a loop variable named test > passes 344ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it inside a for...of loop > reports the rule diagnostic 332ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it.effect inside a for loop nested in describe > reports the rule diagnostic 368ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports test inside a for...in loop > reports the rule diagnostic 343ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports a describe inside a loop once, not the tests inside it > reports the rule diagnostic 316ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it.each inside a for...of loop > reports the rule diagnostic 287ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports a describe.each inside a loop once > reports the rule diagnostic 308ms
✓ rules/no-test-in-loop.test.ts > t3code/no-test-in-loop > reports it.effect.each inside a for loop > reports the rule diagnostic 336ms
✓ rules/no-test-in-loop.test.ts > ignores non-test files > passes 331ms
Test Files 1 passed (1)
Tests 13 passed (13)
Start at 22:25:56
Duration 4.95s (tests 96%, setup 2%, import 1%, transform 1%)
exit=0
Before: vp lint on main with main's rule (0 diagnostics).
$ files=$(git ls-files "*.test.*" "*.spec.*" ":!:.repos"); vp lint $files > /tmp/out 2>&1; s=$?; cat /tmp/out; echo "files: $(echo "$files" | wc -l), lint exit $s, no-test-in-loop diagnostics: $(grep -c "no-test-in-loop" /tmp/out)"
note: You are running `vp lint` as a Vite+ built-in command. If you meant to run the lint npm script, use `vpr lint` instead.
infra/relay/src/t3chat/T3ChatAccounts.test.ts:42:16: warning eslint(require-yield): This generator function does not have `yield` help: Add a `yield` expression inside the generator body, or convert it to a regular function if iteration behavior is not needed.
apps/server/src/provider/acp/AntigravityAcpSupport.test.ts:45:82: warning eslint(require-yield): This generator function does not have `yield` help: Add a `yield` expression inside the generator body, or convert it to a regular function if iteration behavior is not needed.
files: 2054, lint exit 0, no-test-in-loop diagnostics: 0
exit=0
Before: vp lint on main's files with this branch's rule (the 2 loop .each sites).
$ files=$(git ls-files "*.test.*" "*.spec.*" ":!:.repos"); vp lint $files > /tmp/out 2>&1; s=$?; cat /tmp/out; echo "files: $(echo "$files" | wc -l), lint exit $s, no-test-in-loop diagnostics: $(grep -c "no-test-in-loop" /tmp/out)"
note: You are running `vp lint` as a Vite+ built-in command. If you meant to run the lint npm script, use `vpr lint` instead.
infra/relay/src/t3chat/T3ChatAccounts.test.ts:42:16: warning eslint(require-yield): This generator function does not have `yield` help: Add a `yield` expression inside the generator body, or convert it to a regular function if iteration behavior is not needed.
packages/source-control-bitbucket/src/server/BitbucketPullRequestProvider.test.ts:72:3: error t3code(no-test-in-loop): Do not call it.effect.each(…)(…) inside a for loop. Fold the loop into one it.effect.each(cases) list instead.
packages/provider-acp/src/server/elicitationForm.test.ts:7:5: error t3code(no-test-in-loop): Do not call it.each(…)(…) inside a for loop. Fold the loop into one it.each(cases) list instead.
apps/server/src/provider/acp/AntigravityAcpSupport.test.ts:45:82: warning eslint(require-yield): This generator function does not have `yield` help: Add a `yield` expression inside the generator body, or convert it to a regular function if iteration behavior is not needed.
files: 2054, lint exit 1, no-test-in-loop diagnostics: 2
exit=0
After: vp lint on the merged tree (0 diagnostics).
$ files=$(git ls-files "*.test.*" "*.spec.*" ":!:.repos"); vp lint $files > /tmp/out 2>&1; s=$?; cat /tmp/out; echo "files: $(echo "$files" | wc -l), lint exit $s, no-test-in-loop diagnostics: $(grep -c "no-test-in-loop" /tmp/out)"
note: You are running `vp lint` as a Vite+ built-in command. If you meant to run the lint npm script, use `vpr lint` instead.
infra/relay/src/t3chat/T3ChatAccounts.test.ts:42:16: warning eslint(require-yield): This generator function does not have `yield` help: Add a `yield` expression inside the generator body, or convert it to a regular function if iteration behavior is not needed.
apps/server/src/provider/acp/AntigravityAcpSupport.test.ts:45:82: warning eslint(require-yield): This generator function does not have `yield` help: Add a `yield` expression inside the generator body, or convert it to a regular function if iteration behavior is not needed.
files: 2054, lint exit 0, no-test-in-loop diagnostics: 0
exit=0
Generated with Claude Opus 5.5 in T3 Code Nightly
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The rule only matched bare it/test/describe/suite and it.effect/it.live
calls, so it.each(cases)(...), describe.each(cases)(...) and
it.effect.each(cases)(...) registered once per loop iteration passed lint.
The rule now also reports a call whose callee is <test>.each(cases), where
<test> is one of the registration names it already recognizes, and tells
the author to fold the loop into the one .each list. skip/only/skipIf
chains stay allowed, since they have no .each.
Two existing tests registered .each suites in a loop. Their loop values
now live in the case list, with identical test names.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Approvability
Verdict: Approved at 5ca66c3
Macroscope's review found this PR approvable — The lint rule now catches .each test suites declared inside for loops while retaining its existing scope and exemptions. The change affects developer diagnostics, not product defaults or runtime behavior.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 8, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The lint rule now reports supported .each calls inside loops. Two test files consolidate loop-generated tests into parameterized tables while retaining their assertions.
Changes: Test calls in loops
| Layer / File(s) |
Summary |
.each detection and diagnostics oxlint-plugin-t3code/rules/no-test-in-loop.ts, oxlint-plugin-t3code/rules/no-test-in-loop.test.ts |
The rule recognizes and reports supported .each calls inside loops. Tests cover these diagnostics and valid cases. |
Consolidate loop-generated test cases packages/provider-acp/src/server/elicitationForm.test.ts, packages/source-control-bitbucket/src/server/BitbucketPullRequestProvider.test.ts |
Both test files use parameterized tables instead of creating tests through loops. The existing assertions remain. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested labels: size:M
Suggested reviewers: stienswout, macroscopeapp
Merge Risk: Minimal · up to 5ca66
-
This change extends a lint rule and migrates two tests to parameterized tables, with no runtime behavior change. No actionable merge-blocking risk was found.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: the no-test-in-loop lint rule now reports .each suites declared inside a loop. The raw summary confirms the rule now flags .each(cases)(...) calls inside loops, with m… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
| Description check |
 |
The description follows the repository template's Problem, Change, Scope and approval, and Verification sections, and it is detailed and specific. It explains that the no-test-in-loop rule missed para… |
Full details: Title check
-
Explanation
The title names the main change: the no-test-in-loop lint rule now reports .each suites declared inside a loop. The raw summary confirms the rule now flags .each(cases)(...) calls inside loops, with matching valid and invalid test cases, and the two affected test files are migrated. The title follows conventional commit form and is specific, so it passes.
Full details: Description check
-
Explanation
The description follows the repository template's Problem, Change, Scope and approval, and Verification sections, and it is detailed and specific. It explains that the no-test-in-loop rule missed parameterized .each suites declared inside loops, and it names the two affected sites. The Change section lists the rule update, the migration of the two test files, and the new rule test rows. The Verification section gives unedited before and after runs for the rule tests and for repo-wide lint. The Scope and approval section does not link a triaged issue or a maintainer-approved discussion. It argues that the change is a small, focused fix of an obvious gap in a rule a maintainer added (#14921). The template allows a very small, focused fix of an obvious bug to qualify without a prior issue, but the author must justify that. The justification is brief and does not address the template's explicit requirement for approval evidence. The title is not shown in the description, so the conventional commit title requirement cannot be confirmed. The PR objectives say the Bitbucket migrated site count is 19 and the repo-wide file count is 1,979, while the description says 2054 files. That mismatch is a minor inconsistency. Overall the description is mostly complete, but the scope and approval justification is thin.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 71c2d3a and 5ca66c3.
Files selected for processing: 4
-
oxlint-plugin-t3code/rules/no-test-in-loop.test.ts
oxlint-plugin-t3code/rules/no-test-in-loop.ts
packages/provider-acp/src/server/elicitationForm.test.ts
packages/source-control-bitbucket/src/server/BitbucketPullRequestProvider.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note 🤖 Opus 5.5 replying on behalf of Victor.
Closing this to bring my open PRs down under the new limit. The branch stays on my fork if it is useful.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|