fix: run ESLint directly on Next.js 16+ in next_lint tool - #711
Closed
szupzj18 wants to merge 1 commit into
Closed
Conversation
Next.js 16 removed the `next lint` subcommand, so the hardcoded `npx --no-install next lint --format json` invocation is parsed as `next <dir>` and exits without linting. The scan then records reduced coverage (parser_error) and reports zero lint issues, making a Next 16 codebase read as lint-clean. Resolve the command from the installed Next.js major (node_modules/next, not the declared range) and run ESLint directly on >=16; its JSON output has the same shape the next_lint parser expects. ToolIntegration.cmd now accepts a callable resolved per scan root. Fixes peteromallet#709
szupzj18
force-pushed
the
chris/fix/next16-lint-command
branch
from
August 21, 2026 05:31
82ea2fd to
2077e2f
Compare
Author
|
Closing for now — the repo appears unmaintained (no merges since 2026-03, no response on these PRs). The fixes remain valid against the linked issues; happy to reopen if maintainer activity resumes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #709
Next.js 16 removed the
next lintsubcommand. The hardcodednpx --no-install next lint --format jsoninNEXTJS_SPECis now parsed asnext <dir>and exits without linting:The tool phase records reduced coverage (
parser_error) and reports zero lint issues, so a Next 16 codebase reads as lint-clean.Fix
next_lint_cmd(scan_root)resolves the command from the installed Next.js major (node_modules/next/package.json, not the declared range —^15.0.0can resolve to 16). On >= 16 it runsnpx --no-install eslint --format json .directly; ESLint's JSON output has the same shape thenext_lintparser already consumes.ToolIntegration.cmdnow acceptsstr | Callable[[Path], str];_framework_tool_phaseresolves it per scan root.next lintwhen Next is not installed, the version is unreadable, or the major is < 16.Tests
next_lint_cmd: Next 16 → ESLint command; Next 15 →next lint; missing install → fallback; malformed package.json → fallback.next@16executes the ESLint command (verified RED with the old static command — argv containedlint);next@15still executesnext lint.desloppify/tests/detectors+tests/scan: 974 passed. Full suite: only the pre-existingtest_bash_unused_source_directive_is_flaggedfailure (fails onmainwithout this change too).Checklist
ruff --select E9,F63,F7,F82scope)