feat: port PR 217 lint rule coverage#251
Conversation
Bring over the remaining false-positive fixes and missing oxlint rule families from the v2 PR so the current split-package plugin keeps parity with the intended rule surface.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🔴 React Review — 0/100 (unchanged) · Copy prompt for agentReviewed by react-review for commit 7be0058. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1e24096. Configure here.
| if (!isStoryFile) return; | ||
| const keyName = isNodeOfType(node.key, "Identifier") ? node.key.name : null; | ||
| if (keyName === "play" && playFunctionDepth > 0) playFunctionDepth--; | ||
| }, |
There was a problem hiding this comment.
Storybook rule exit handler missing function-value guard
Medium Severity
The Property enter handler only increments playFunctionDepth when the play property's value is an ArrowFunctionExpression or FunctionExpression. The Property:exit handler decrements for any play property regardless of value type. A nested play property with a non-function value (e.g. play: composedPlay) inside a real play function would decrement the counter prematurely, causing the rule to miss unawaited userEvent calls in the remainder of the outer play function.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1e24096. Configure here.
| import type { EsTreeNode } from "../../utils/es-tree-node.js"; | ||
|
|
||
| const I18N_IMPORT_SOURCES = new Set(["i18next", "next-intl", "react-i18next"]); | ||
| const TRANSLATION_FUNCTION_NAMES = new Set(["t", "i18n.t"]); |
There was a problem hiding this comment.
Unreachable "i18n.t" entry in translation function set
Medium Severity
TRANSLATION_FUNCTION_NAMES includes "i18n.t", but the CallExpression handler only matches Identifier callees via isNodeOfType(node.callee, "Identifier"). An i18n.t() call has a MemberExpression callee, so this entry can never match. Calls like i18n.t(dynamicKey) are silently ignored despite being an intended detection target.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1e24096. Configure here.
| export const testingAwaitUserEvent = defineRule<Rule>({ | ||
| id: "testing-await-user-event", | ||
| severity: "error", | ||
| recommendation: |
| if ( | ||
| !isNodeOfType(node.callee, "Identifier") || | ||
| !translationFunctionNames.has(node.callee.name) | ||
| ) { | ||
| return; | ||
| } |


Summary
Test plan
Note
Medium Risk
Adds many new lint rules and broadens file-pattern heuristics, which can change diagnostics significantly and may introduce false positives/negatives. Also modifies the security-critical
nextjs-no-side-effect-in-get-handlerdetection logic, so rule behavior should be validated against real Next.js route patterns.Overview
Expands
oxlint-plugin-react-doctorwith new rule buckets and rules covering i18n, React Hook Form, React Three Fiber, SWR, Storybook/Testing Library, TanStack AI, client event listeners, and server streaming/caching/perf patterns; the rule registry generator and generatedrule-registry.tsare updated accordingly.Improves several existing detectors and constants: broader test/infra path matching, new Next.js route patterns (App Router/OG/cron), additional React unsubscription naming, new thresholds, and refinements to performance/correctness rules (e.g.
js-length-check-first,js-set-map-lookups,async-parallel,no-uncontrolled-input,rn-no-raw-text,no-prevent-default).Hardens
nextjs-no-side-effect-in-get-handlerby resolvingGEThandler bodies through simple top-level binding lookup and chained.get(...)handler patterns (and skipping cron routes) before scanning for side effects.Reviewed by Cursor Bugbot for commit 1e24096. Bugbot is set up for automated code reviews on this repo. Configure here.