Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@docusaurus/eslint-plugin is not compatible with ESLint 9 #10490

Open
1 of 2 tasks
Zamiell opened this issue Sep 11, 2024 · 9 comments
Open
1 of 2 tasks

@docusaurus/eslint-plugin is not compatible with ESLint 9 #10490

Zamiell opened this issue Sep 11, 2024 · 9 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Milestone

Comments

@Zamiell
Copy link
Contributor

Zamiell commented Sep 11, 2024

Have you read the Contributing Guidelines on issues?

Description

See this dependency: https://github.com/facebook/docusaurus/blob/main/packages/eslint-plugin/package.json#L24

This needs to be upgraded to max, or else satisfying the peer deps is impossible on ESLint 9.

  • I'd be willing to fix this bug myself.
@Zamiell Zamiell added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Sep 11, 2024
@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Sep 11, 2024
@slorber
Copy link
Collaborator

slorber commented Sep 11, 2024

Thanks

I didn't have time to study the problem, but is the change retro-compatible and can be done in a minor?

@Josh-Cena you probably have an idea?

@Josh-Cena
Copy link
Collaborator

I haven't updated a plugin to ESLint v9 so I don't know if that would suffice, but so I hope. Does flat config require a new recommended config format?

@Zamiell
Copy link
Contributor Author

Zamiell commented Sep 11, 2024

Not sure.

@Josh-Cena
Copy link
Collaborator

For now, let's include v9 in the peer dep range, and then people can try it out. Worst case they would need to apply workarounds like they already do with other plugins like plugin-react-hooks. Once I become more informed about how shared flat configs work, we can make it a new entry point like many other plugins are doing, and none of these changes would be semver breaking.

@PaulRBerg
Copy link
Contributor

This is the workaround:

import pluginDocusaurus from "@docusaurus/eslint-plugin";

export default [
  // ...
  {
    plugins: {
      "@docusaurus": pluginDocusaurus,
    },
    rules: pluginDocusaurus.configs.recommended.rules,
  },
  // ...
];

Related thread: https://github.com/facebook/react/issues/28313

@Zamiell
Copy link
Contributor Author

Zamiell commented Feb 23, 2025

@Josh-Cena Bump - Any updates on this issue? Do you want me to just do a 1 line PR that updates the dep to latest?

@slorber
Copy link
Collaborator

slorber commented Feb 24, 2025

If it's just a 1 line PR yes, but is it?

Sending a package.json PR is easy and has little value on its own unless you have a plan to validate that the change actually works with ESLint v9. I haven't really looked at ESLint 9 to know what should be done.


BTW what is the goal of that PR?

Afaik our deps already allow v9:

  "peerDependencies": {
    "eslint": ">=6"
  },

Have you encountered any problems with the workaround @PaulRBerg suggested?

@Zamiell
Copy link
Contributor Author

Zamiell commented Feb 24, 2025

The goal of the PR would be to squash the "peer requirements cannot be met" warning/error when running "npm install". For context, basically any modern ESLint setup can no longer use the Docusaurus plugin without getting the warning/error.

@slorber
Copy link
Collaborator

slorber commented Feb 24, 2025

I see thanks,

The warning problem is due to "@typescript-eslint/utils": "^5.62.0",

ESLint v9 is only supported in peerDeps of utils v8:

https://github.com/typescript-eslint/typescript-eslint/blob/v8.0.0/packages/utils/package.json

But this also restricts the semver range of both ESLint and Node.js: we can't do that in Docusaurus v3, otherwise this might force plugin users to upgrade to ESLint >= 8 (we support >= 6) or Node.js >= 18.18 (we support >= 18.0)

Let's schedule the upgrade of this package to v4.

@slorber slorber added this to the 4.0 milestone Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

No branches or pull requests

4 participants