test: ensure @eslint/markdown works with both ESLint v9 and v10#593
test: ensure @eslint/markdown works with both ESLint v9 and v10#593lumirlumir wants to merge 28 commits intomainfrom
@eslint/markdown works with both ESLint v9 and v10#593Conversation
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.
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,
]); |
26895f7 to
34c2553
Compare
| "dedent": "^1.7.1", | ||
| "eslint": "^9.39.2", | ||
| "eslint": "^9.39.3", | ||
| "eslint-v9": "npm:eslint@9.x", |
There was a problem hiding this comment.
I've followed the same pattern used for the ESLint v9 jiti library installation.
Ref: https://github.com/eslint/eslint/blob/v9.39.3/package.json#L178-L179
This also addresses the comment mentioned in #605 (comment).
@eslint/* dep, support ESLint v10@eslint/markdown works with both ESLint v9 and v10
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