Skip to content

fix: update @eslint/core to v1.0.0 and adjust tests#190

Merged
mdjermanovic merged 9 commits intomainfrom
chore-update-dependency-eslint-core-v1
Jan 1, 2026
Merged

fix: update @eslint/core to v1.0.0 and adjust tests#190
mdjermanovic merged 9 commits intomainfrom
chore-update-dependency-eslint-core-v1

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 #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

Ref: #187, #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 lumirlumir changed the title chore: update dependency @eslint/core to v1 chore: update @eslint/core to v1 and add legacy-peer-deps to .npmrc Dec 2, 2025
@eslint-github-bot
Copy link

Hi @lumirlumir!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The length of the commit message must be less than or equal to 72

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

@lumirlumir lumirlumir changed the title chore: update @eslint/core to v1 and add legacy-peer-deps to .npmrc chore: update @eslint/core to v1 and add legacy-peer-deps Dec 2, 2025
@lumirlumir lumirlumir changed the title chore: update @eslint/core to v1 and add legacy-peer-deps chore: update @eslint/core, add legacy-peer-deps, and use ESLint v10 prerelease Dec 2, 2025
@eslint-github-bot
Copy link

Hi @lumirlumir!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The length of the commit message must be less than or equal to 72

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

@lumirlumir lumirlumir changed the title chore: update @eslint/core, add legacy-peer-deps, and use ESLint v10 prerelease chore: update @eslint/core, add legacy-peer-deps, and use ESLint v10 Dec 2, 2025
Copy link
Member Author

Choose a reason for hiding this comment

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

From ESLint v10, errors property in valid test case throws error, so I've removed it.

Ref: https://eslint.org/docs/next/use/migrate-to-10.0.0#stricter-rule-tester

@lumirlumir lumirlumir marked this pull request as ready for review December 2, 2025 17:21
@lumirlumir
Copy link
Member Author

Counterpart PR in eslint/css: eslint/css#337

"license": "Apache-2.0",
"dependencies": {
"@eslint/core": "^0.17.0",
"@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.

Since this is a dependency, will this affect end users who are still using ESLint v9?

Copy link
Member

Choose a reason for hiding this comment

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

The next release will be a major one, so I think it's okay.

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

I'm wondering -- can we just update the types test to use Plugin from @eslint/core instead of ESLint.Plugin?

"license": "Apache-2.0",
"dependencies": {
"@eslint/core": "^0.17.0",
"@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.

The next release will be a major one, so I think it's okay.

@lumirlumir lumirlumir requested a review from fasttime December 4, 2025 02:59
@lumirlumir
Copy link
Member Author

When I look at the history of the ESLint.plugin test, it appears it was added primarily to ensure compatibility with the ESLint.plugin type before the @eslint/core package was stabilized.

Below is the git blame for the related PRs in chronological order:

Personally, I think it would be fine to replace the ESLint.plugin type from eslint with the Plugin type from @eslint/core, since ESLint.plugin is identical to the Plugin type in both v9 and v10.

Would anyone from @eslint/eslint-tsc have any further thoughts on this?

@fasttime
Copy link
Member

fasttime commented Dec 7, 2025

When I look at the history of the ESLint.plugin test, it appears it was added primarily to ensure compatibility with the ESLint.plugin type before the @eslint/core package was stabilized.

Yes, the Plugin type in @eslint/core was added recently, in v0.16.0 (eslint/rewrite#237).

Personally, I think it would be fine to replace the ESLint.plugin type from eslint with the Plugin type from @eslint/core, since ESLint.plugin is identical to the Plugin type in both v9 and v10.

Would anyone from @eslint/eslint-tsc have any further thoughts on this?

I think that's fine.

@lumirlumir lumirlumir moved this from Needs Triage to Implementing in Triage Dec 7, 2025
Copilot AI review requested due to automatic review settings December 7, 2025 12:09
@lumirlumir
Copy link
Member Author

Per the suggestions, I've updated types.test.ts to use the Plugin type instead of ESLint.Plugin in d7d3b71

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

This PR updates the repository to work with ESLint v10 pre-release versions and @eslint/core v1.0.0, addressing type compatibility issues between these packages. The changes align with the pattern established in eslint/eslint#20281 for adopting ESLint v10 pre-releases.

  • Updated @eslint/core from ^0.17.0 to ^1.0.0 to include ESLint v10 type information
  • Added legacy-peer-deps = true to .npmrc to bypass peer dependency conflicts during the pre-release period
  • Updated ESLint dependency to use the version range >=10.0.0-alpha.0 <10.0.0 || ^10.0.1 to support v10 pre-releases

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
package.json Updated @eslint/core to v1.0.0 and ESLint to v10 pre-release version range
.npmrc Added legacy-peer-deps flag with TODO comment for removal after ESLint v10 stable release
tests/types/types.test.ts Updated type imports to use Plugin from @eslint/core instead of ESLint.Plugin
tests/rules/sort-keys.test.js Removed erroneous errors array from valid test case (fix for ESLint v10 compatibility)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nzakas
Copy link
Member

nzakas commented Dec 10, 2025

Do we still need legacy-peer-deps?

@lumirlumir
Copy link
Member Author

I think it's still needed, since sub-dependencies of the eslint-config-eslint package, such as eslint-plugin-jsdoc, still require ^7.0.0 || ^8.0.0 || ^9.0.0 rather than v10.

"eslint-config-eslint": "^13.0.0",

https://github.com/gajus/eslint-plugin-jsdoc/blob/3cd7cbddecf01b59c07c8fba850da24228cb50ef/package.json#L149-L151

image

When I run npm install without legacy-peer-deps, I get the following errors:

image

Per the comments above and the discussion at eslint/js#709 (comment), I added a commit 466cdc6 to clarify the description in .npmrc and to set the eslint version to >=10.0.0-alpha.0 <10.0.0 || ^10.0.0.

SwetaTanwar
SwetaTanwar previously approved these changes Dec 12, 2025
@SwetaTanwar SwetaTanwar moved this from Implementing to Second Review Needed in Triage Dec 12, 2025
@nzakas
Copy link
Member

nzakas commented Dec 29, 2025

Right, but if we keep this using ESLint v9 for linting, then I don't think we need legacy-peer-deps. There doesn't appear to be any reason to have a direct dependency on ESLint v10?

@lumirlumir
Copy link
Member Author

lumirlumir commented Dec 31, 2025

Right, but if we keep this using ESLint v9 for linting, then I don't think we need legacy-peer-deps. There doesn't appear to be any reason to have a direct dependency on ESLint v10?

I have missed that it switched to the Plugin type instead of ESLint.Plugin in #190 (comment). I'll revert the PR to use ESLint v9 and remove legacy-peer-deps.

Also, I've marked the PR prefix as fix since it updates dependencies, as discussed in eslint/workflows#33 (comment).


I've reverted the changes in 1cb0fa8.

@lumirlumir lumirlumir changed the title chore: update @eslint/core, add legacy-peer-deps, and use ESLint v10 chore: update @eslint/core and update tests Dec 31, 2025
@lumirlumir lumirlumir changed the title chore: update @eslint/core and update tests chore: update @eslint/core to v1.0.0 Dec 31, 2025
@lumirlumir lumirlumir changed the title chore: update @eslint/core to v1.0.0 fix: update @eslint/core to v1.0.0 and adjust tests Dec 31, 2025
@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Dec 31, 2025
@lumirlumir lumirlumir removed the chore label Dec 31, 2025
@lumirlumir
Copy link
Member Author

lumirlumir commented Dec 31, 2025

Question:

Would there be a plan to remove rollup and migrate to an ESM-only package for the upcoming v1.0.0 stable release?

I opened an issue with more details: #196

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. Would like @mdjermanovic to review before merging.

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit ba31cc2 into main Jan 1, 2026
22 checks passed
@mdjermanovic mdjermanovic deleted the chore-update-dependency-eslint-core-v1 branch January 1, 2026 17:50
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted bug Something isn't working

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

6 participants