ESLint: Drop @eslint/compat fixup for jest-dom and testing-library - #80842
Merged
Conversation
Both plugins now declare ESLint v10 support, so the fixupPluginRules wrapper added during the v10 migration is no longer needed. eslint-plugin-react and eslint-plugin-import still call context APIs removed in v10, so their fixups stay.
manzoorwanijk
marked this pull request as ready for review
July 29, 2026 11:30
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 7.76 MB |
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?
Follow up to #76654.
Updates
eslint-plugin-jest-domandeslint-plugin-testing-libraryto versions that support ESLint v10, and drops thefixupPluginRulescompat wrapper for both. Also bumpseslint-plugin-importto 2.32.0.Why?
The
@eslint/compatwrappers added during the ESLint v10 migration were meant to be temporary. Botheslint-plugin-jest-domandeslint-plugin-testing-librarynow declareeslint ^10support, so the shim is dead weight there.How?
Probed every rule of all four wrapped plugins against ESLint 10.6.0 with the fixup removed, to check which ones actually still break:
eslint-plugin-jest-dom^5.5.0→^5.6.0eslint-plugin-testing-library^7.16.0→^7.16.2eslint-plugin-reacteslint-plugin-import^2.31.0→^2.32.0eslint-plugin-react7.37.5 (latest) still callscontext.getFilename(),context.getSourceCode()andsourceCode.isSpaceBetweenTokens(), breakingjsx-filename-extension,jsx-curly-spacing,jsx-equals-spacing,jsx-tag-spacing,jsx-one-expression-per-lineandforward-ref-uses-ref. Four of those are enabled in this repo, so the fixup stays.eslint-plugin-import2.32.0 still reads the removedcontext.parserOptionsinno-default-export,no-named-exportandunambiguous—lib/core/sourceType.jsis byte-identical between 2.31.0 and 2.32.0, so the bump doesn't help. The fixup stays.@eslint/compatis therefore removed fromtools/eslintbut kept inpackages/eslint-plugin, whereconfigs/react.jsandconfigs/recommended-with-formatting.jsstill need it.In
tools/eslint/config.mjsthe explicitplugins: { ... }overrides on the jest-dom and testing-library entries are also gone: they only existed to inject the wrapped plugin, and each config already registers its own plugin.Testing Instructions
npm installnpm run lint:js— passes with no errors.jest-dom/*and 22testing-library/*rules.Verified locally: full
npm run lint:jsreports 0 errors, and the 456 warnings are all pre-existingplaywright/*,react-hooks/exhaustive-depsandjest/expect-expect. A scratch test file with deliberate violations correctly triggeredjest-dom/prefer-enabled-disabled,jest-dom/prefer-in-documentandtesting-library/prefer-presence-queries.Testing Instructions for Keyboard
N/A — tooling only.
Use of AI Tools
Authored with Claude Code; the plugin compatibility probing and the resulting changes were reviewed and verified locally.