Skip to content

fix: use ESLint CLI for Next.js 16 framework scans - #760

Open
jimmybrancaccio wants to merge 1 commit into
peteromallet:mainfrom
jimmybrancaccio:fix/next16-eslint-command
Open

jimmybrancaccio wants to merge 1 commit into
peteromallet:mainfrom
jimmybrancaccio:fix/next16-eslint-command

Conversation

@jimmybrancaccio

Copy link
Copy Markdown

Next.js 16 removed next lint, so the framework detector currently reports reduced coverage without checking lint findings. Resolve the command from the installed Next.js version: use eslint . --format json on 16+, preserving the existing command when the version is older or unknown. Missing ESLint still produces reduced coverage through the existing tool runner.

Adds an optional per-project command resolver to framework tool integrations. The existing ESLint JSON parser and coverage handling remain in use.

Fixes #709.

Validation:

  • 19 focused Next.js framework tests passed, including behavioral checks that the selected command reaches the tool runner.
  • Full desloppify/tests/: 5,811 passed, 3 skipped, one Nim tree-sitter failure reproduced on unchanged HEAD.
  • Ran the patched framework phase against an actual Next.js 16.3.1 project: selected ESLint, reported three file-level findings across 37 checked files, with no coverage warnings. The original command failed with an unsupported --format option.

Copilot AI lite review requested due to automatic review settings September 18, 2026 20:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Next.js 16 workspaces may fail module detection when dependencies are hoisted, falling back to the unsupported next lint command.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates Next.js framework lint integration to use ESLint for Next.js 16+ while preserving legacy behavior for older or unknown versions.

Changes:

  • Adds per-project tool command resolution.
  • Detects Next.js versions and selects the appropriate lint command.
  • Adds focused behavioral and fallback tests.
File summaries
File Description
desloppify/languages/typescript/tests/test_ts_nextjs_framework.py Tests version-based command selection and fallback behavior.
desloppify/languages/_framework/frameworks/types.py Adds optional command resolver support.
desloppify/languages/_framework/frameworks/specs/nextjs.py Selects ESLint for Next.js 16+.
desloppify/languages/_framework/frameworks/phases.py Resolves tool commands per scan root.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

def _next_lint_command(scan_root: Path) -> str | None:
"""Use ESLint directly when the installed Next.js no longer provides lint."""
try:
package = json.loads((scan_root / "node_modules/next/package.json").read_text())

This branch has not been deployed

No deployments
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.

next_lint detector silently reports zero issues on Next.js 16 (next lint was removed)

2 participants