fix: update @eslint/* dep, support ESLint v10#593
Conversation
package.json
Outdated
| "dependencies": { | ||
| "@eslint/core": "^0.17.0", | ||
| "@eslint/plugin-kit": "^0.4.1", | ||
| "@eslint/core": "^1.0.0", |
There was a problem hiding this comment.
Same question as eslint/json#190 (comment). We can clarify there, just wanted to leave a note here as well so that we don't merge until this is clarified.
@eslint/* dep, add legacy-peer-deps, use ESLint v10@eslint/* dep, support ESLint v10
There was a problem hiding this comment.
Currently, both eslint-plugin-react and typescript-eslint do not yet support ESLint v10 as a peer dependency, I've used the latest v9 versions.
There was a problem hiding this comment.
The test strategy follows the CSS and JSON.
| }); | ||
|
|
||
| // https://github.com/eslint/markdown/issues/181 | ||
| it("should work when called on nested code blocks in the same file", async () => { |
There was a problem hiding this comment.
As mentioned in #605 (comment), I preserved backward compatibility in the tests by checking ESLint's version and dynamically importing eslint/use-at-your-own-risk.
I also removed L1465-L1510 because the test "should work when called on nested code blocks in the same file" is duplicated, it's already covered in the LegacyESLint section and appears to have been misplaced in the FlatESLint section.
Lines 350 to 351 in 69a5221
But, It would be nice if this could also be checked with flat config, but I'm not sure how to make the test work in ESLint v10.
There was a problem hiding this comment.
Pull request overview
Updates the package and test harness to work with the newer @eslint/* packages and to validate compatibility across ESLint v9 and v10.
Changes:
- Bump
@eslint/coreand@eslint/plugin-kitand adjust type tests to use@eslint/core’sPlugintype. - Update test code to use
ESLintdirectly, lazily importLegacyESLint, and skip legacy-only tests on ESLint v10+. - Expand CI to run tests/typechecks against multiple ESLint versions (including 10.x).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Updates @eslint/core / @eslint/plugin-kit versions to align with ESLint v10 types/tooling. |
tests/types/types.test.ts |
Updates type assertions to use Plugin from @eslint/core instead of ESLint.Plugin. |
tests/plugin.test.js |
Refactors ESLint imports/initialization for v10, adds version gating for legacy tests, and makes LegacyESLint import lazy. |
tests/examples/all.test.js |
Switches example validation from FlatESLint to ESLint. |
src/index.js |
Uses JSDoc @satisfies for processorRulesConfig typing. |
examples/react/package.json |
Updates example devDependencies (ESLint/@eslint/js versions). |
examples/typescript/package.json |
Updates example devDependencies (ESLint/@eslint/js/typescript/typescript-eslint versions). |
.github/workflows/ci.yml |
Expands the ESLint version matrix and installs ESLint per-matrix entry for tests and type checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…update-eslint-core-plugin-kit
|
While working on this, I've found a v9 type compatibility issue, so I'm marking this as a draft until a decision is reached in eslint/json#213. I used the JSON plugin as an example because newer major versions of CSS and Markdown haven't been released yet. Note to myself: This PR also need to address #605 (comment). |
|
Perhaps this nickdeis/eslint-plugin-no-secrets#44 may help 🚑 with fixes 🪛 |
|
Note: Currently, the only way to make Markdown plugin 🔌 work with ESLint v10 is to use the following config: import markdown from '@eslint/markdown';
import { defineConfig } from 'eslint/config';
export default defineConfig([
...markdown.configs.processor,
]); |
Prerequisites checklist
What is the purpose of this pull request?
This PR was motivated by eslint/json#187 (comment).
Currently, when updating
@eslint/coreto v1.0.0, CI fails because@eslint/core@1.0.0does not match ESLint v9@eslint/core@1.0.0includes type information for ESLint v10, which causes the type mismatch.So, I've updated ESLint to
>=10.0.0-alpha.0 <10.0.0 || ^10.0.1. (Ref: https://github.com/eslint/eslint/blob/main/packages/eslint-config-eslint/package.json#L66)When I update ESLint to
>=10.0.0-alpha.0 <10.0.0 || ^10.0.1, the following error occurs, so I added thelegacy-peer-depsoption to.npmrc.This change follows the approach in eslint/eslint#20281
What changes did you make? (Give an overview)
In this PR, I've updated
@eslint/core, addlegacy-peer-deps, and use ESLint v10 pre-release.Related Issues
Fixes: #621
Ref: #584, #586, eslint/json#187 (comment), eslint/eslint#20281
Is there anything you'd like reviewers to focus on?
N/A