Skip to content

chore!: next.js 16 prep: bump eslint-config-next + @next/eslint-plugin-next to v16 (#932)#939

Merged
NoopDog merged 3 commits into
mainfrom
fran/932-eslint-config-next-v16
May 27, 2026
Merged

chore!: next.js 16 prep: bump eslint-config-next + @next/eslint-plugin-next to v16 (#932)#939
NoopDog merged 3 commits into
mainfrom
fran/932-eslint-config-next-v16

Conversation

@frano-m

@frano-m frano-m commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Part of #884 (Next.js 16 upgrade plan).

Bumps eslint-config-next + @next/eslint-plugin-next to v16, which forces ESLint 8→9, which cascades into multiple plugin updates required to keep the lint stack working under flat-config + ESLint 9.

Core bumps

  • eslint: ^8.57.1^9
  • @eslint/js: ^8.57.1^9
  • eslint-config-next: ^15.5.13^16
  • @next/eslint-plugin-next: ^15.5.13^16
  • Drop the ESLINT_USE_FLAT_CONFIG=true env-var prefix from the lint script (ESLint 9 makes flat config the default).

Plugin cascade (forced by ESLint 9 compat)

  • eslint-plugin-sonarjs: ^0.25.1^1 (v0.25 uses removed context.getScope API).
  • eslint-plugin-react-hooks: ^5.2.0^7.
  • eslint-plugin-sort-destructure-keys: ^2^3 (peer range widened to ESLint 9/10).
  • eslint-plugin-jsdoc: ^61.5.0^63.
  • @typescript-eslint/eslint-plugin: ^8.50.0^8.59.0 (minor).

Plugin replacements

  • eslint-plugin-typescript-sort-keyseslint-plugin-perfectionist (the former is abandoned; pinned to ESLint 7-8). Replaces our two rules:
    • typescript-sort-keys/interfaceperfectionist/sort-interfaces
    • typescript-sort-keys/string-enumperfectionist/sort-enums
  • eslint-plugin-eslint-comments@eslint-community/eslint-plugin-eslint-comments (community fork; the original was last released in 2022 and uses old ESLint internals). Drop-in (rule names unchanged: @eslint-community/eslint-comments/require-description).

Flat-config adjustments

  • eslint-config-next v16 ships a native flat config that doesn't roundtrip cleanly through FlatCompat (circular JSON during schema validation). Direct-imported as import next from "eslint-config-next" and spread before the compat.config(...) block.
  • eslint-plugin-sonarjs v1 same situation. Direct-imported as import sonarjs from "eslint-plugin-sonarjs" and added as sonarjs.configs.recommended.

Node version bump

  • Repo pin: 22.12.022.13.0 (package.json#engines + 3 CI workflow refs + Copilot instructions doc). eslint-plugin-jsdoc@63 requires node ^22.13.0 || >=24; staying on 22.12.0 would emit EBADENGINE warnings. Same LTS line, patch-level bump only.

Rule-set notes

  • New react-hooks v7 rules disabled. v7 ships React-Compiler-aware checks (refs, immutability, set-state-in-effect, incompatible-library, static-components) that surface ~20 real anti-patterns across the codebase. These are out of scope for a tooling PR — disabled here with a comment, follow-up ticket to be filed.
  • sonarjs/cognitive-complexity restored explicitly at threshold 15. sonarjs v1's recommended preset silently dropped this rule (the rule's meta.docs.recommended flag was lost during the v1 rewrite, a discrepancy with the package README). Restoring preserves the coverage we had under v0.25. Documented in an inline comment.

Source-file changes (pure cleanup, no behavior change)

ESLint 9 enables report-unused-disable-directives by default. --fix removed several stale eslint-disable comments that were orphans from past refactors: valid-jsdoc (rule removed in ESLint 9), @typescript-eslint/no-explicit-any (the any had been taken out of the code), @typescript-eslint/no-empty-function (function bodies no longer empty in a way the rule cares about), sort-keys (keys had been alphabetized at some point).

Test plan

  • npm run lint — clean (one pre-existing no-html-link-for-pages informational notice from @next/eslint-plugin-next — findable-ui is a library, not an app)
  • npm run check-format — clean
  • npm run test-compile — clean
  • npm test — 447/447 pass
  • Local-link smoke test in data-biosphere (fran/x-nextjs-test, anvil-cmg dev) — dev server compiles + runs cleanly against the patched findable-ui

Compatibility scope (revised)

This PR lands a stack compatible with ESLint 9. Forward-compat with ESLint 10 will require additional work: eslint-plugin-sonarjs@1 only declares peer support for ^8 || ^9 — a bump to eslint-plugin-sonarjs@4 (or whichever version officially adds v10) will be needed before adopting ESLint 10. Filing as a follow-up.

Closes #932

…-next to v16 (#932)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 26, 2026 07:26
@frano-m frano-m marked this pull request as ready for review May 26, 2026 07:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the repository’s linting toolchain as part of the Next.js 16 upgrade plan by bumping eslint-config-next/@next/eslint-plugin-next to v16 (requiring ESLint 9) and adjusting the flat-config setup and plugin set to remain functional under ESLint 9.

Changes:

  • Bump ESLint core + Next ESLint config/plugin to v16 and update the supporting ESLint plugin stack for ESLint 9 compatibility.
  • Update eslint.config.mjs to direct-import Next + SonarJS flat configs, replace deprecated plugins (eslint-comments fork, sort-keys plugin replacement), and reapply/adjust rules.
  • Remove stale eslint-disable directives across the codebase now that ESLint 9 reports unused disables by default.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
eslint.config.mjs Updates flat-config composition (direct Next + SonarJS configs), swaps plugins (perfectionist, eslint-comments fork), and adjusts rules for ESLint 9.
package.json Bumps ESLint/Next ESLint packages and updates/replaces several ESLint plugins; simplifies lint script for ESLint 9 flat-config default.
package-lock.json Locks the updated ESLint/Next lint stack and transitive dependency changes.
src/theme/common/components.ts Removes now-unused sort-keys disable comments.
src/providers/fileManifestState.tsx Removes unused no-empty-function disable.
src/providers/exploreState.tsx Removes unused no-empty-function disable.
src/entity/service/model.ts Removes an unused no-explicit-any disable in a signature where it no longer applies.
src/config/utils.ts Removes an unused no-explicit-any disable in a signature where it no longer applies.
src/components/Table/common/utils.ts Removes unused no-empty-function disable in a callback config object.
src/components/MarkdownRenderer/rehypeHighlight.ts Removes unused sonarjs/cognitive-complexity disable.
src/components/Index/table/hook.ts Removes unused inline sonarjs/cognitive-complexity disable.
src/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/columnFiltersAdapter.tsx Removes unused no-unused-vars disables where underscore-prefixed args are already ignored.
src/components/common/Paper/paper.styles.ts Removes legacy valid-jsdoc disable/enable comments (rule no longer relevant).

Comment thread package.json
Comment thread package.json
frano-m and others added 2 commits May 26, 2026 18:38
eslint-plugin-jsdoc@63 requires node ^22.13.0 || >=24; bumping the repo
pin and CI workflows to a same-LTS patch release satisfies the engine
constraint without other behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sync README, CLAUDE.md, and trusted-publishing doc with the bumped node
pin. CHANGELOG entries left as historical record.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 26, 2026 08:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated no new comments.

@frano-m frano-m changed the title chore: next.js 16 prep: bump eslint-config-next + @next/eslint-plugin-next to v16 (#932) chore!: next.js 16 prep: bump eslint-config-next + @next/eslint-plugin-next to v16 (#932) May 27, 2026
@NoopDog NoopDog merged commit 42b73de into main May 27, 2026
3 checks passed
@frano-m frano-m deleted the fran/932-eslint-config-next-v16 branch May 27, 2026 05:27
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.

[P1.7] Next.js 16 prep: bump eslint-config-next + @next/eslint-plugin-next to v16

3 participants