Skip to content

Commit aa04fda

Browse files
fix(react-doctor): fix 3 bugs, resolve AGENTS.md violations, upgrade oxc
Bugs fixed: - tanstackStartRedirectInTryCatch: was using node.parent which oxlint JS plugins don't populate — rule never fired. Rewrote to use ThrowStatement visitor with tryCatchDepth tracking (matches existing nextjs pattern) - tanstackStartServerFnValidateInput: fragile chain-walking logic with potential infinite loop. Extracted shared walkServerFnChain() helper, removed unused serverFnChains variable - tanstackStartNoNavigateInRender: componentDepth never decremented for arrow components (no VariableDeclarator:exit), eventHandlerDepth was declared but never modified. Removed dead variable, simplified AGENTS.md violations fixed: - Removed unused hasDirective import - Moved SEQUENTIAL_AWAIT_THRESHOLD_FOR_LOADER to constants.ts - Moved TANSTACK_REDIRECT_FUNCTIONS to constants.ts - Moved TANSTACK_SERVER_FN_FILE_PATTERN to constants.ts - Replaced inline /^[A-Z]/ with existing UPPERCASE_PATTERN constant - Replaced duplicate MUTATION_CALLEE_NAMES with existing MUTATION_METHOD_NAMES - Removed 'as string' type cast, replaced with typeof guard Upgraded oxc: - oxlint: 1.59.0 → 1.60.0 - oxfmt: 0.44.0 → 0.45.0 Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
1 parent 34b7828 commit aa04fda

5 files changed

Lines changed: 304 additions & 337 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"devDependencies": {
3030
"@changesets/cli": "^2.30.0",
3131
"eslint-plugin-react-hooks": "^7.0.1",
32-
"oxfmt": "^0.44.0",
33-
"oxlint": "^1.59.0",
32+
"oxfmt": "^0.45.0",
33+
"oxlint": "^1.60.0",
3434
"tsdown": "^0.21.7",
3535
"typescript": "^6.0.2",
3636
"vitest": "^4.1.4"

packages/react-doctor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"eslint-plugin-react-hooks": "^7.0.1",
5353
"knip": "^6.3.1",
5454
"ora": "^9.3.0",
55-
"oxlint": "^1.59.0",
55+
"oxlint": "^1.60.0",
5656
"picocolors": "^1.1.1",
5757
"prompts": "^2.4.2",
5858
"typescript": ">=5.0.4 <7"

packages/react-doctor/src/plugin/constants.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ export const TANSTACK_MIDDLEWARE_METHOD_ORDER = [
210210
"handler",
211211
];
212212

213+
export const TANSTACK_REDIRECT_FUNCTIONS = new Set(["redirect", "notFound"]);
214+
215+
export const TANSTACK_SERVER_FN_FILE_PATTERN = /\.functions(\.[jt]sx?)?$/;
216+
217+
export const SEQUENTIAL_AWAIT_THRESHOLD_FOR_LOADER = 2;
218+
213219
export const GENERIC_EVENT_SUFFIXES = new Set(["Click", "Change", "Input", "Blur", "Focus"]);
214220

215221
export const TRIVIAL_INITIALIZER_NAMES = new Set([

0 commit comments

Comments
 (0)