build(deps-dev): migrate to ESLint 10 and flat config - #702
Merged
Merged
Conversation
dcalhoun
added this pull request to stack #703
September 18, 2026 20:20
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/702")Built from dc2ecef |
dcalhoun
commented
Sep 18, 2026
Comment on lines
+146
to
+147
| "eslint-plugin-import": { | ||
| "eslint": "$eslint" |
Member
Author
There was a problem hiding this comment.
The latest eslint-plugin-import release declares a peer of eslint@^9. This overrides the peer to match the root eslint version.
dcalhoun
marked this pull request as ready for review
September 18, 2026 20:34
ESLint 9 changes the `no-unused-vars` default for `caughtErrors` from "none" to "all", which flags these bindings. None are read, so use the optional catch binding instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ESLint 10's `no-shadow` reports a named function expression whose name shadows the binding it is assigned to. Adopt Gutenberg's convention for `forwardRef` components, which keeps a useful name in React DevTools. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`@wordpress/eslint-plugin` 25.0.0 dropped eslintrc and raised its peer to ESLint 9 or 10, so the ESLint 8 pin had quietly frozen the WordPress ruleset two majors back at 24.3.0. Gutenberg itself now runs ESLint 10, and with the pin gone the Dependabot ignores it justified go too. `eslint-plugin-import` has not widened its peer range past ESLint 9, so its `eslint` peer is overridden to the root version. That is narrower than the repo-wide `legacy-peer-deps` Gutenberg relies on. Flat config does not ignore dot directories the way eslintrc did, so `.build/` is named explicitly to keep ESLint out of the SwiftPM output. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Name the config file agents should open, and record that the Playwright ruleset deliberately skips `e2e/**/*.test.js` so a future widening of the glob does not pull vitest tests back under rules that reject them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dcalhoun
force-pushed
the
build/upgrade-eslint
branch
from
September 21, 2026 17:49
7f4087d to
dc2ecef
Compare
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.
What?
Update to ESLint 10 now that Gutenberg core's packages support it.
Why?
Keep up-to-date with Gutenberg and other dependencies.
How?
Testing Instructions
N/A, no user-facing changes.
Accessibility Testing Instructions
N/A, no user-facing changes.
Screenshots or screencast
N/A, no user-facing changes.
Agent summary
WordPress/gutenberg#64782 is closed —
@wordpress/eslint-pluginsupports ESLint 9 and 10 as of 25.0.0, which also dropped eslintrc. The ESLint 8 pin had frozen the WordPress ruleset two majors back at 24.3.0 (no plugin bump since March 2026).Toolchain:
eslint8.57 → 10.10,@wordpress/eslint-plugin24.3 → 26.0,eslint-plugin-react-refresh0.4 → 0.5,globalsadded. Matches Gutenberg, which runs ESLint 10.Config:
.eslintrc.cjs,e2e/.eslintrc.cjs, and.eslintignorebecomeeslint.config.js. Three details are deliberate:import/resolveris carried over. Without it,import/no-unresolvedfails on the patched@wordpress/block-editorsubpaths (extensionlessexportstargets) and on@wordpress/preferences-persistence(itstypescondition names unpublished build output).test-playwrightskipse2e/**/*.test.js.eslint-plugin-playwrightgoes 0.15 → 2.x, whose rules read vitestit()blocks as stray assertions — 17 errors ine2e/fetch-json.test.jsotherwise..build/is ignored explicitly. Flat config does not skip dot directories, so ESLint otherwise walks the 1.5 GB SwiftPM output.Peer range:
eslint-plugin-import@2.32.0still caps at ESLint 9, so itseslintpeer is overridden to the root version — narrower than the repo-widelegacy-peer-depsGutenberg uses.Code changes: 9 unused
catchbindings (ESLint 9 flippedno-unused-varscaughtErrorsto"all") and 2forwardRefcomponents renamed to Gutenberg'sUnforwarded*convention (ESLint 10no-shadowflags a named function expression shadowing its own binding).Why stacked on #691: plugin 26 depends on
@wordpress/theme2.x, whose modern subtree makes npm dedupe 10 in-range production@wordpress/*packages upward. On trunk that is unwanted drift in a lint PR; on #691 those packages already sit at exactly those versions, so the lock diff stays confined to the lint subtree.Verified:
make lint-jsclean (112 files linted vs. 110 before — gains.prettierrc.cjsand the config itself, none dropped), 231 unit tests pass,check:wp-packagespasses. E2E not run.Follow-up: the
@typescript-eslint/typescript-estree→minimatch9.0.9override is now a forced major downgrade (typescript-estree 8 declares^10.2.2) with no corresponding advisory. npm will not drop the lock entry without hand-editing it, so it is left for a separate PR.🤖 Generated with Claude Code