Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
"verify-links": "node scripts/verify-links.ts"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.3",
"@arethetypeswrong/cli": "^0.18.2",
"@eslint-react/eslint-plugin": "^1.26.2",
"@playwright/test": "^1.52.0",
"@playwright/test": "^1.56.1",
"@tanstack/config": "0.22.0",
"@tanstack/react-query": "^5.90.0",
"@tanstack/query-core": "^5.90.0",
"@tanstack/react-query": "^5.90.7",
"@tanstack/query-core": "^5.90.7",
"@types/node": "22.10.2",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"@vitest/browser": "^3.0.6",
"@vitest/ui": "^3.0.6",
"eslint": "^9.22.0",
Expand All @@ -54,9 +54,9 @@
"markdown-link-extractor": "^4.0.2",
"nx": "21.3.7",
"prettier": "^3.6.2",
"publint": "^0.3.12",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"publint": "^0.3.15",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"redaxios": "^0.5.1",
"rimraf": "^6.0.1",
"tinyglobby": "^0.2.12",
Expand Down
1 change: 1 addition & 0 deletions packages/react-router/src/fileRoute.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react-hooks/rules-of-hooks */
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

ESLint rule 'react-hooks/rules-of-hooks' is not defined.

Same issue as in packages/react-router/src/route.tsx: the ESLint directive references a rule that doesn't exist in the current configuration, rendering the directive ineffective.

Verify that eslint-plugin-react-hooks is properly installed and configured. See the verification script provided in the review comment for packages/react-router/src/route.tsx (Line 1).


🏁 Script executed:

#!/bin/bash
# Find ESLint configuration files and check for eslint-plugin-react-hooks
echo "=== ESLint Config Files ===" 
fd -e 'js' -e 'json' -e 'cjs' -e 'mjs' --type f | grep -E '(eslint|\.eslintrc)' | head -20

echo -e "\n=== Looking for eslintrc in root and common locations ==="
find . -maxdepth 2 -type f \( -name '.eslintrc*' -o -name 'eslint.config.*' \) 2>/dev/null

echo -e "\n=== Checking package.json for react-hooks plugin ==="
if [ -f "package.json" ]; then
  cat package.json | grep -A 5 -B 5 "react-hooks" || echo "Not found in root package.json"
fi

echo -e "\n=== Checking packages/react-router/package.json ==="
if [ -f "packages/react-router/package.json" ]; then
  cat packages/react-router/package.json | grep -A 5 -B 5 "react-hooks" || echo "Not found in react-router package.json"
fi

echo -e "\n=== Viewing fileRoute.ts line 1 ==="
if [ -f "packages/react-router/src/fileRoute.ts" ]; then
  head -5 packages/react-router/src/fileRoute.ts
else
  echo "File not found"
fi

echo -e "\n=== Viewing route.tsx line 1 ==="
if [ -f "packages/react-router/src/route.tsx" ]; then
  head -5 packages/react-router/src/route.tsx
else
  echo "File not found"
fi

Length of output: 1770


🏁 Script executed:

#!/bin/bash
# Check eslint.config.js for react-hooks plugin configuration
echo "=== Content of eslint.config.js ==="
cat eslint.config.js

echo -e "\n=== Searching for react-hooks references ==="
grep -n "react-hooks" eslint.config.js || echo "No react-hooks found in root eslint.config.js"

echo -e "\n=== Checking if react-router has its own eslint config ==="
if [ -f "packages/react-router/eslint.config.js" ]; then
  echo "=== packages/react-router/eslint.config.js exists ==="
  cat packages/react-router/eslint.config.js
else
  echo "No eslint.config.js in packages/react-router"
fi

echo -e "\n=== Checking for node_modules/eslint-plugin-react-hooks ==="
if [ -d "node_modules/eslint-plugin-react-hooks" ]; then
  echo "Plugin directory exists"
  ls -la node_modules/eslint-plugin-react-hooks/ | head -15
else
  echo "Plugin not found in node_modules"
fi

Length of output: 1552


🏁 Script executed:

#!/bin/bash
# Check @tanstack/config for react-hooks plugin
echo "=== Looking for @tanstack/config eslint export ==="
find node_modules/@tanstack/config -name '*.js' -o -name '*.ts' | head -20

echo -e "\n=== Checking @tanstack/config/eslint ==="
if [ -f "node_modules/@tanstack/config/eslint.js" ]; then
  cat node_modules/@tanstack/config/eslint.js
elif [ -f "node_modules/@tanstack/config/dist/eslint.js" ]; then
  cat node_modules/@tanstack/config/dist/eslint.js
elif [ -f "node_modules/@tanstack/config/eslint/index.js" ]; then
  cat node_modules/@tanstack/config/eslint/index.js
else
  echo "Checking package.json exports"
  if [ -f "node_modules/@tanstack/config/package.json" ]; then
    cat node_modules/@tanstack/config/package.json | grep -A 20 '"exports"'
  fi
fi

echo -e "\n=== Searching for react-hooks in @tanstack/config directory ==="
grep -r "react-hooks" node_modules/@tanstack/config 2>/dev/null | head -10 || echo "Not found"

Length of output: 650


🏁 Script executed:

#!/bin/bash
# Read the actual eslint.js file
echo "=== Content of @tanstack/config/dist/esm/eslint.js ==="
cat node_modules/@tanstack/config/dist/esm/eslint.js

echo -e "\n=== Verify if react-hooks/rules-of-hooks rule is available ==="
grep -i "rules-of-hooks" node_modules/@tanstack/config/dist/esm/eslint.js || echo "Not found in eslint.js"

Length of output: 263


🏁 Script executed:

#!/bin/bash
# Find @tanstack/eslint-config and check for react-hooks
echo "=== Looking for @tanstack/eslint-config ==="
find node_modules/@tanstack/eslint-config -type f \( -name '*.js' -o -name 'package.json' \) 2>/dev/null | head -20

echo -e "\n=== Checking for main export in @tanstack/eslint-config/package.json ==="
if [ -f "node_modules/@tanstack/eslint-config/package.json" ]; then
  cat node_modules/@tanstack/eslint-config/package.json | grep -E '"main"|"exports"|"type"' | head -10
fi

echo -e "\n=== Looking for index file ==="
for f in node_modules/@tanstack/eslint-config/index.js node_modules/@tanstack/eslint-config/dist/index.js node_modules/@tanstack/eslint-config/dist/esm/index.js; do
  if [ -f "$f" ]; then
    echo "Found: $f"
    cat "$f" | head -100
    break
  fi
done

echo -e "\n=== Grep for react-hooks in entire @tanstack/eslint-config ==="
grep -r "react-hooks" node_modules/@tanstack/eslint-config 2>/dev/null | head -5 || echo "Not found"

Length of output: 213


🏁 Script executed:

#!/bin/bash
# Find what @tanstack packages exist
echo "=== Available @tanstack packages ==="
ls -la node_modules/@tanstack 2>/dev/null | head -30

echo -e "\n=== Search for tanstackConfig definition ==="
grep -r "export.*tanstackConfig" node_modules/@tanstack 2>/dev/null | head -20

echo -e "\n=== Check package.json for @tanstack/eslint-config or similar ==="
grep -r "@tanstack/eslint-config" node_modules 2>/dev/null | head -5 || echo "Not found"

echo -e "\n=== Try to resolve the import ==="
node -e "try { const mod = require.resolve('@tanstack/eslint-config'); console.log('Resolved to:', mod); } catch(e) { console.log('Not found:', e.message); }"

Length of output: 1797


🏁 Script executed:

#!/bin/bash
# Find @tanstack/eslint-config in pnpm structure
ESLINT_CONFIG_PATH=$(find node_modules/.pnpm -name "@tanstack+eslint-config*" -type d | head -1)

if [ -z "$ESLINT_CONFIG_PATH" ]; then
  echo "Not found"
  exit 1
fi

ESLINT_CONFIG_PATH="$ESLINT_CONFIG_PATH/node_modules/@tanstack/eslint-config"

echo "=== Found @tanstack/eslint-config at: $ESLINT_CONFIG_PATH ==="

echo -e "\n=== Files in directory ==="
ls -la "$ESLINT_CONFIG_PATH" 2>/dev/null | head -20

echo -e "\n=== Looking for main/dist files ==="
for f in "$ESLINT_CONFIG_PATH"/index.js "$ESLINT_CONFIG_PATH"/dist/index.js "$ESLINT_CONFIG_PATH"/dist/esm/index.js; do
  if [ -f "$f" ]; then
    echo "=== Found and reading: $f ==="
    cat "$f" | head -150
    break
  fi
done

echo -e "\n=== Grep for react-hooks in config ==="
grep -r "react-hooks" "$ESLINT_CONFIG_PATH" 2>/dev/null || echo "Not found"

Length of output: 616


🏁 Script executed:

#!/bin/bash
# Find @tanstack/eslint-config source files
ESLINT_CONFIG_PATH=$(find node_modules/.pnpm -name "@tanstack+eslint-config*" -type d | head -1)
ESLINT_CONFIG_PATH="$ESLINT_CONFIG_PATH/node_modules/@tanstack/eslint-config"

echo "=== Files in src directory ==="
ls -la "$ESLINT_CONFIG_PATH/src" 2>/dev/null

echo -e "\n=== Content of src files ==="
for f in "$ESLINT_CONFIG_PATH"/src/*; do
  if [ -f "$f" ]; then
    echo "=== $f ==="
    cat "$f" | head -200
  fi
done

echo -e "\n=== Check package.json exports ==="
cat "$ESLINT_CONFIG_PATH/package.json"

Length of output: 10928


Enable ESLint's react-hooks plugin in the configuration.

The eslint-plugin-react-hooks package is installed, but the plugin is not registered in the ESLint configuration (@tanstack/eslint-config). The react-hooks/rules-of-hooks rule is therefore undefined, making the /* eslint-disable react-hooks/rules-of-hooks */ directive ineffective.

Add the plugin to the ESLint configuration to resolve this issue in both fileRoute.ts and route.tsx.

🧰 Tools
🪛 ESLint

[error] 1-1: Definition for rule 'react-hooks/rules-of-hooks' was not found.

(react-hooks/rules-of-hooks)

🤖 Prompt for AI Agents
In packages/react-router/src/fileRoute.ts (and similarly
packages/react-router/src/route.tsx), the file-level eslint-disable for
react-hooks is ineffective because the react-hooks plugin isn't registered;
update the @tanstack/eslint-config configuration to add "react-hooks" to the
plugins array and enable the canonical rules (e.g., set
"react-hooks/rules-of-hooks": "error" and "react-hooks/exhaustive-deps": "warn"
or your preferred severities) so those rules are defined project-wide, then
remove the local /* eslint-disable react-hooks/rules-of-hooks */ comments from
the two files.

import warning from 'tiny-warning'
import { createRoute } from './route'

Expand Down
1 change: 1 addition & 0 deletions packages/react-router/src/route.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react-hooks/rules-of-hooks */
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

ESLint rule 'react-hooks/rules-of-hooks' is not defined.

The ESLint directive references a rule that doesn't exist in the current configuration. This means the directive has no effect and any violations it was intended to suppress will still be reported (or the linting will fail if strict mode is enabled).

This issue likely stems from the dependency updates in this PR. Verify that eslint-plugin-react-hooks is properly installed and configured in the ESLint configuration.

Run the following script to verify the ESLint configuration and plugin installation:


🏁 Script executed:

#!/bin/bash
# Check if eslint-plugin-react-hooks is installed and verify available rules

echo "=== Checking package.json for eslint-plugin-react-hooks ==="
cat package.json | jq '.devDependencies["eslint-plugin-react-hooks"], .dependencies["eslint-plugin-react-hooks"]'

echo -e "\n=== Checking workspace package.json files ==="
fd -t f "package.json" -x sh -c 'echo "File: {}"; cat {} | jq -r "select(.devDependencies[\"eslint-plugin-react-hooks\"] or .dependencies[\"eslint-plugin-react-hooks\"]) | \"Found in: \" + (input_filename // \"\")"' 2>/dev/null || fd -t f "package.json" -x sh -c 'echo "{}:"; cat {} | jq ".devDependencies[\"eslint-plugin-react-hooks\"], .dependencies[\"eslint-plugin-react-hooks\"]" | grep -v null'

echo -e "\n=== Checking ESLint config for react-hooks plugin ==="
fd -t f "eslint.config" -x cat {}

echo -e "\n=== Attempting to list available rules from plugin (if Node.js available) ==="
node -e "try { const plugin = require('eslint-plugin-react-hooks'); console.log('Available rules:', Object.keys(plugin.rules || {})); } catch(e) { console.log('Could not load plugin:', e.message); }" 2>&1 || echo "Node.js check skipped"

Length of output: 22819


Configure eslint-plugin-react-hooks in packages/react-router/eslint.config.js or remove the unnecessary directive.

The react-hooks/rules-of-hooks rule is unavailable in the packages/react-router configuration because the plugin is not registered. In packages/react-router/eslint.config.js, the eslint-plugin-react-hooks import and plugin registration are commented out, rendering the eslint-disable directive at line 1 of route.tsx ineffective.

Either uncomment the plugin configuration in eslint.config.js to enable the rule, or remove the directive if the rule is not needed for this package.

🧰 Tools
🪛 ESLint

[error] 1-1: Definition for rule 'react-hooks/rules-of-hooks' was not found.

(react-hooks/rules-of-hooks)

🤖 Prompt for AI Agents
In packages/react-router/src/route.tsx around line 1, there's an unnecessary
eslint-disable comment for react-hooks/rules-of-hooks because
eslint-plugin-react-hooks is not registered in
packages/react-router/eslint.config.js (its import and plugin registration are
commented out); fix by either uncommenting and properly importing/registering
eslint-plugin-react-hooks in packages/react-router/eslint.config.js so the rule
is active, or remove the top-line eslint-disable directive from route.tsx if you
decide the rule should not apply in this package.

import {
BaseRootRoute,
BaseRoute,
Expand Down
Loading
Loading