Skip to content

Comments

fix: update @eslint/* dep, support ESLint v10#593

Draft
lumirlumir wants to merge 24 commits intomainfrom
chore-update-eslint-core-plugin-kit
Draft

fix: update @eslint/* dep, support ESLint v10#593
lumirlumir wants to merge 24 commits intomainfrom
chore-update-eslint-core-plugin-kit

Conversation

@lumirlumir
Copy link
Member

@lumirlumir lumirlumir commented Dec 2, 2025

Prerequisites checklist

What is the purpose of this pull request?

This PR was motivated by eslint/json#187 (comment).

Currently, when updating @eslint/core to v1.0.0, CI fails because @eslint/core@1.0.0 does not match ESLint v9

@eslint/core@1.0.0 includes 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 the legacy-peer-deps option to .npmrc.

This change follows the approach in eslint/eslint#20281

image

What changes did you make? (Give an overview)

In this PR, I've updated @eslint/core, add legacy-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

@eslintbot eslintbot added this to Triage Dec 2, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Dec 2, 2025
@lumirlumir
Copy link
Member Author

Unlike the PRs in JSON and CSS, the Markdown plugin needs further investigation to support ESLint v10. I'm marking this as a draft for now and will investigate it soon.

@lumirlumir lumirlumir moved this from Needs Triage to Implementing in Triage Dec 2, 2025
package.json Outdated
"dependencies": {
"@eslint/core": "^0.17.0",
"@eslint/plugin-kit": "^0.4.1",
"@eslint/core": "^1.0.0",
Copy link
Member

Choose a reason for hiding this comment

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

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.

@lumirlumir lumirlumir changed the title chore: update @eslint/* dep, add legacy-peer-deps, use ESLint v10 fix: update @eslint/* dep, support ESLint v10 Feb 8, 2026
@eslint-github-bot eslint-github-bot bot added the bug label Feb 8, 2026
Copy link
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

@lumirlumir lumirlumir Feb 8, 2026

Choose a reason for hiding this comment

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

});

// https://github.com/eslint/markdown/issues/181
it("should work when called on nested code blocks in the same file", async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

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.

// https://github.com/eslint/markdown/issues/181
it("should work when called on nested code blocks in the same file", async () => {

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.

@lumirlumir lumirlumir marked this pull request as ready for review February 8, 2026 13:00
@lumirlumir lumirlumir requested a review from nzakas February 8, 2026 13:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/core and @eslint/plugin-kit and adjust type tests to use @eslint/core’s Plugin type.
  • Update test code to use ESLint directly, lazily import LegacyESLint, 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.

@lumirlumir
Copy link
Member Author

lumirlumir commented Feb 15, 2026

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).

@lumirlumir lumirlumir marked this pull request as draft February 15, 2026 14:54
@bricss
Copy link

bricss commented Feb 19, 2026

Perhaps this nickdeis/eslint-plugin-no-secrets#44 may help 🚑 with fixes 🪛

@bricss
Copy link

bricss commented Feb 19, 2026

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,
]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Implementing

Development

Successfully merging this pull request may close these issues.

Bug: plugins: { markdown },

4 participants