Skip to content

fix(eslint): add eslint package to ESLint toolchain devDependencies#425

Open
gs0428 wants to merge 1 commit intoTanStack:mainfrom
gs0428:gs0428/eslint
Open

fix(eslint): add eslint package to ESLint toolchain devDependencies#425
gs0428 wants to merge 1 commit intoTanStack:mainfrom
gs0428:gs0428/eslint

Conversation

@gs0428
Copy link
Copy Markdown

@gs0428 gs0428 commented Apr 5, 2026

Description

Closes #417

When users select the ESLint toolchain during project creation, the eslint package was missing from devDependencies, even though @tanstack/eslint-config declares it as a peer dependency. This caused peer dependency warnings and prevented ESLint from running properly.

Changes

Added "eslint": "^9.20.0" to devDependencies in both React and Solid ESLint toolchain configurations:

  • packages/create/src/frameworks/react/toolchains/eslint/package.json
  • packages/create/src/frameworks/solid/toolchains/eslint/package.json

Why?

@tanstack/eslint-config has the following peer dependency requirement:

"peerDependencies": {
  "eslint": "^8.0.0 || ^9.0.0"
}

Peer dependencies are not automatically installed, so the CLI must explicitly include eslint in the generated project's devDependencies to satisfy this requirement.

Testing

  • pnpm build - successful
  • pnpm test - all tests pass (75 unit + 3 e2e)
  • Manual testing: Created a new app with ESLint toolchain and verified:
    • eslint package appears in package.json devDependencies
    • npm run lint executes without peer dependency warnings
    • ESLint runs correctly

Before & 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

  • Chores
    • ESLint (^9.20.0) is now an explicit development dependency in React and Solid framework toolchain configurations.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2026

📝 Walkthrough

Walkthrough

Added explicit eslint v9.20.0 as a development dependency in ESLint toolchain package.json files for React and Solid frameworks, addressing the missing dependency required by @tanstack/eslint-config.

Changes

Cohort / File(s) Summary
ESLint Toolchain Dependencies
packages/create/src/frameworks/react/toolchains/eslint/package.json, packages/create/src/frameworks/solid/toolchains/eslint/package.json
Added eslint: ^9.20.0 to devDependencies in both framework scaffolding templates, ensuring the linter is explicitly available when selected during CLI setup.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A hop, a skip, a lint so fine,
ESLint's bundled, now it's mine!
No more missing, no more fuss,
Dependencies clear for all of us!
thump thump

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding the eslint package to ESLint toolchain devDependencies, which is the core objective of the PR.
Linked Issues check ✅ Passed The PR fully addresses issue #417 by adding eslint to devDependencies for both React and Solid frameworks, exactly as required to resolve the peer dependency warnings and enable ESLint functionality.
Out of Scope Changes check ✅ Passed All changes are directly scoped to resolving issue #417; only the necessary eslint dependency additions to two framework-specific ESLint toolchain package.json files are included.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4cd8184 and d943f18.

📒 Files selected for processing (2)
  • packages/create/src/frameworks/react/toolchains/eslint/package.json
  • packages/create/src/frameworks/solid/toolchains/eslint/package.json

},
"devDependencies": {
"@tanstack/eslint-config": "latest",
"eslint": "^9.20.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 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.yaml

Repository: 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:


🏁 Script executed:

cat -n packages/create/src/frameworks/react/toolchains/eslint/package.json

Repository: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESLint not added to devDependencies when selected during CLI setup

1 participant