fix(eslint): add eslint package to ESLint toolchain devDependencies#425
fix(eslint): add eslint package to ESLint toolchain devDependencies#425gs0428 wants to merge 1 commit intoTanStack:mainfrom
Conversation
📝 WalkthroughWalkthroughAdded explicit Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/create/src/frameworks/react/toolchains/eslint/package.json`:
- Line 9: The package.json currently pins "eslint": "^9.20.0" but the template's
engines.node allows ">=18", which is too low for ESLint 9.20.0; update the
package.json engines.node value (the "engines" / "engines.node" field) to
">=18.18.0" so the template's minimum Node.js matches ESLint 9.20.0's
requirement and prevents installing on unsupported Node versions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3254a955-b468-4eff-a977-9e1380a33783
📒 Files selected for processing (2)
packages/create/src/frameworks/react/toolchains/eslint/package.jsonpackages/create/src/frameworks/solid/toolchains/eslint/package.json
| }, | ||
| "devDependencies": { | ||
| "@tanstack/eslint-config": "latest", | ||
| "eslint": "^9.20.0", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Verify ESLint is declared in both framework ESLint toolchains
fd -a package.json packages/create/src/frameworks | grep '/toolchains/eslint/package.json$' \
| xargs -I{} sh -c 'echo "==> {}"; jq -r ".devDependencies.eslint // \"missing\"" "{}"'
# Verify the peer range in lockfile still accepts ESLint 9.x
rg -n -C2 'eslint:\s*\^8\.0\.0 \|\| \^9\.0\.0' pnpm-lock.yamlRepository: TanStack/cli
Length of output: 389
🌐 Web query:
ESLint 9.20.0 Node.js minimum version compatibility
💡 Result:
ESLint 9.20.0 requires Node.js ^18.18.0 or higher. The v9 series initially supported Node.js 18.18.0+, as confirmed for early v9 releases. The requirement was updated later in the v9 series (after September 2025, via PR #20160) to ^20.19.0 || ^22.13.0 || >=24, dropping Node.js 18 support, but this change occurred after the 9.20.0 release on February 7, 2025. Release notes, changelog, and npm page for 9.20.0 do not mention a Node version change.
Citations:
- 1: https://www.npmjs.com/package/eslint/v/9.20.0?activeTab=code
- 2: What is the minimum node version supported by eslint v9? eslint/eslint#19614
- 3: eslint/eslint@588b664
- 4: https://github.com/eslint/eslint/releases/tag/v9.20.0
- 5: https://eslint.org/blog/2025/02/eslint-v9.20.0-released
🏁 Script executed:
cat -n packages/create/src/frameworks/react/toolchains/eslint/package.jsonRepository: TanStack/cli
Length of output: 389
Node.js compatibility issue: Update template's minimum Node.js version to match ESLint 9.20.0 requirement.
The React ESLint toolchain correctly declares "eslint": "^9.20.0". However, ESLint 9.20.0 requires Node.js ^18.18.0, but the template's engines field specifies only >=18, which would allow Node.js 18.0.0–18.17.x where ESLint 9.20.0 won't run. Update the template's Node.js minimum to >=18.18.0 to ensure compatibility.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/create/src/frameworks/react/toolchains/eslint/package.json` at line
9, The package.json currently pins "eslint": "^9.20.0" but the template's
engines.node allows ">=18", which is too low for ESLint 9.20.0; update the
package.json engines.node value (the "engines" / "engines.node" field) to
">=18.18.0" so the template's minimum Node.js matches ESLint 9.20.0's
requirement and prevents installing on unsupported Node versions.
Description
Closes #417
When users select the ESLint toolchain during project creation, the
eslintpackage was missing fromdevDependencies, even though@tanstack/eslint-configdeclares it as a peer dependency. This caused peer dependency warnings and prevented ESLint from running properly.Changes
Added
"eslint": "^9.20.0"todevDependenciesin both React and Solid ESLint toolchain configurations:packages/create/src/frameworks/react/toolchains/eslint/package.jsonpackages/create/src/frameworks/solid/toolchains/eslint/package.jsonWhy?
@tanstack/eslint-confighas the following peer dependency requirement:Peer dependencies are not automatically installed, so the CLI must explicitly include eslint in the generated project's
devDependenciesto satisfy this requirement.Testing
eslintpackage appears inpackage.jsondevDependenciesnpm run lintexecutes without peer dependency warningsBefore & After
Before
{ "devDependencies": { "@tanstack/eslint-config": "latest", "prettier": "^3.8.1" } }Missing eslint → peer dependency warning
After
{ "devDependencies": { "@tanstack/eslint-config": "latest", "eslint": "^9.20.0", "prettier": "^3.8.1" } }Complete ESLint setup with all required dependencies
Summary by CodeRabbit
^9.20.0) is now an explicit development dependency in React and Solid framework toolchain configurations.