Skip to content

chore(deps): eslint-config-next 16 — native flat config, drop FlatCompat - #37

Merged
tbcsec merged 1 commit into
mainfrom
chore/eslint-major-bump
Jul 25, 2026
Merged

chore(deps): eslint-config-next 16 — native flat config, drop FlatCompat#37
tbcsec merged 1 commit into
mainfrom
chore/eslint-major-bump

Conversation

@tbcsec

@tbcsec tbcsec commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Progresses #15 — with one finding that changes its endgame (commented on the issue).

What changed

  • eslint-config-next 15.5 → 16.2.12 (the major [Dependency] Upgrade eslint / eslint-config-next to clear the brace-expansion advisory #15 asked for): it now ships native flat configs, so eslint.config.mjs imports them directly and the FlatCompat shim + the direct @eslint/eslintrc devDependency are gone.
  • eslint stays on latest 9.x (9.39.5) — the 10.x half of [Dependency] Upgrade eslint / eslint-config-next to clear the brace-expansion advisory #15 is blocked upstream: the latest eslint-plugin-react (7.37.5, which config-next 16 bundles) peer-caps at eslint ^9.7 and still calls context.getFilename(), an API eslint 10 removed. Verified empirically — eslint 10 crashes on rule load.
  • config-next 16 bundles react-hooks v7 with the React-Compiler-era rules as errors; the codebase carries 27 hits of deliberate pre-compiler idioms across 17 files. Downgraded those five rules to warn (visible in editors/CI output, not a gate) rather than mixing a 17-file behavioral refactor into a deps PR — follow-up issue to burn them down. rules-of-hooks / exhaustive-deps stay errors.

The advisory (the actual point of #15) is not clearable today

GHSA-mh99-v99m-4gvg published 2026-07-24 — patched only in brace-expansion@5.0.8, no 1.x–4.x backports. Every minimatch ≤ 10.0.2 in the ecosystem (eslint 9 core, @eslint/config-array, config-next's bundled plugins) requires brace-expansion as a bare CJS function; 5.x exports a namespace. An overrides pin to 5.0.8 was tried and breaks every lint run (TypeError: expand is not a function), so it's reverted. npm audit still reports the one advisory via 9 dev-only paths; there is no fix path anywhere in the ecosystem yet (no post-advisory minimatch releases as of today).

Dev-only lint tooling, never shipped to production — unchanged risk posture from when #15 was filed.

Verification

  • npx eslint .0 errors (27 tracked warnings)
  • npm run test — 109 passed · npx tsc --noEmit clean · npm run build clean

🤖 Generated with Claude Code

The achievable half of #15. eslint-config-next 16 ships native flat
configs, so FlatCompat and the direct @eslint/eslintrc dep go away.
eslint itself stays on latest 9.x: eslint 10 is blocked upstream —
eslint-plugin-react (7.37.5, bundled by config-next) peer-caps at ^9.7
and uses the removed context.getFilename API (verified: crashes on rule
load).

The bundled react-hooks v7 adds five React-Compiler-era rules as
errors; the codebase carries 27 deliberate pre-compiler idioms across
17 files, so those rules are set to warn (tracked follow-up) instead of
mixing a behavioral refactor into a deps bump. rules-of-hooks and
exhaustive-deps stay errors.

The brace-expansion advisory (GHSA-mh99-v99m-4gvg) itself is not
clearable today: published yesterday, patched only in 5.0.8 with no
backports, and 5.x's CJS namespace export breaks every minimatch ≤ 3
consumer (an overrides pin was tried — every lint run crashes). Dev-only
tooling; risk posture unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tbcsec
tbcsec merged commit 19f122e into main Jul 25, 2026
3 checks passed
@tbcsec
tbcsec deleted the chore/eslint-major-bump branch July 25, 2026 23:03
tbcsec added a commit that referenced this pull request Jul 25, 2026
main's Docker image build is failing: react-hooks/purity (new in the
react-hooks v7 that eslint-config-next 16 brought in via #37) errors on
the Date.now() call added in #41's archive confirm dialog, because the
component body counts as render scope.

Neither PR's CI could catch it — #41 branched before #37 merged, so it
linted against react-hooks v5 where the rule didn't exist, and #37 never
saw #41's code. A semantic merge conflict that only exists on main.

Hoists the description builder to a module-level archiveWarning(); the
rule only analyzes component/hook bodies, and the copy reads better
extracted. Deliberately not a rule downgrade — it caught a real purity
violation. Also drops a stale comment claiming archive/delete aren't
wired.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
tbcsec added a commit that referenced this pull request Jul 26, 2026
Guards the failure mode that broke main after #41: two PRs that are each
green can still break main together, when one adds a lint rule and the
other adds a violation of it.

GitHub does build the merge result for pull_request events — but it
computes that merge ref when the PR is pushed and never recomputes it as
the base moves. #41's run therefore tested itself merged into a main
that predated #37's eslint upgrade, so the rule that would have caught
its Date.now() call didn't exist yet in that checkout. Both PRs were
green; only their combination was broken, and the image build on main
was the first job to see it.

The new job merges origin/main as of the moment it runs, so re-running
it answers "would this break main right now?" — unlike the other jobs,
whose answer is frozen at push time. Lint + build only: this is aimed at
cross-PR tooling drift, which is exactly what the build surfaces, and
the full suites already run on the branch.

Verified against the real history: a worktree at #41's head merged with
#37 reproduces `64:15 Cannot call impure function during render` and
exits non-zero — the exact error that reached main.

Co-authored-by: ci <ci@x>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@tbcsec tbcsec added the dependencies Pull requests that update a dependency file label Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant