ITADN

Ready for the next breaking change

#269Openlumirlumir 创建于 2026-01-09
L
lumirlumircommented
Hi community team! Thanks for having me, and thanks for the time and effort you've put in here. I'm opening this issue to discuss the next breaking change for `@eslint-community/eslint-plugin-eslint-comments`. There are currently two PRs that include breaking changes (https://github.com/eslint-community/eslint-plugin-eslint-comments/pull/266 and https://github.com/eslint-community/eslint-plugin-eslint-comments/pull/268), but it seems the policy or standards are not fully aligned. For the next major release, I propose the following items and their rationales. ## 1. Drop support under Node.js 18 and require `^20.19.0 || ^22.13.0 || >=24` From the ESLint v10, we now support only `^20.19.0 || ^22.13.0 || >=24`. Node.js 18 have faced it's end-of-life, and the next major version update timining of `@eslint-community/eslint-plugin-eslint-comments` will align with the stable release of ESLint v10. Especially since Node.js `^20.19.0 || ^22.13.0 || >=24` enables `require(ESM)` by default without an experimental flag, parts of the ESLint plugin ecosystem are moving to ESM-only (https://github.com/eslint/json/issues/196). It would be nice to align with this and migrate the codebase to ESM-only (for the built code) and TypeScript (for the source code), as is being done in https://github.com/eslint-community/eslint-plugin-eslint-comments/pull/266. Just for reference, if we plan to support ESLint versions earlier than v10 (for example, v9 or v8), I think we can still support them even if we drop Node.js 18, since there is no technical blocker to using the latest Node.js versions. > Conclusion: `^20.19.0 || ^22.13.0 || >=24` ## 2. Drop support under ESLint v8.57.0 Based on the comment in the `typescript-eslint` repository (https://github.com/typescript-eslint/typescript-eslint/issues/11629#issuecomment-3383467807), the current ESLint proportions are as follows: | ESLint Major | Weekly DL # | User % | | ------------ | ----------- | ------ | | 7 | 4,407,794 | 7.16% | | 8 | 26,896,711 | 43.7% | | 9 | 26,087,723 | 42.39% | I think it makes sense to support up to ESLint v8 — specifically v8.57.0 — since `typescript-eslint` also supports the range `^8.57.0 || ^9.0.0`, and aligning with it would be helpful. (However, I also think dropping v8 could be a nice option, and I would actually prefer that change 😄) Also, the minimum required ESLint version for the language plugins such as JSON/CSS/Markdown is 9.15.0. It seems that support for language plugins has been added in https://github.com/eslint-community/eslint-plugin-eslint-comments/pull/257. Ref: https://github.com/eslint/markdown/blob/6371d740cd763ea0c4319d3664bdd7bbd8fb6dd5/README.md?plain=1#L20 So, for the above reason, I'd like to suggest listing ESLint as a `peerDependency` with the range `^8.57.0 || ^9.15.0 || ^10.0.0`, or something similar. (The `^9.15.0` version can be raised since there are no tests for it in the language plugins, so I'll need to re-verify.) --- After further discussion in the issue threads, it seems the team favors dropping support for ESLint v8. I'll set the minimum requirement to `^9.39.2 || ^10.0.0` to align with `eslint-plugin-n`'s approach (https://github.com/eslint-community/eslint-plugin-n/pull/503). > Conclusion: `^9.39.2 || ^10.0.0` ## 3. Add a `peerDependencies` field to language plugins and mark it as optional (`"optional": true`) ESLint now officially supports language plugins such as JSON, CSS, and Markdown. Support for this was added in https://github.com/eslint-community/eslint-plugin-eslint-comments/pull/257, but there don't seem to be any version restrictions for those plugins. As I understand it, early versions of these plugins lack certain methods, so users on older versions might encounter unexpected behavior or bugs. Therefore, I propose adding the following field to restrict plugin versions: ```json "peerDependencies": { "eslint": "^9.39.2 || ^10.0.0", "@eslint/markdown": "^8.0.0", "@eslint/json": "^1.0.0", "@eslint/css": "^1.0.0", }, "peerDependenciesMeta": { "@eslint/markdown": { "optional": true }, "@eslint/json": { "optional": true }, "@eslint/css": { "optional": true }, }, ``` If we add the `optional` field, these plugins won't be installed automatically, and the restriction will only apply when the language plugins are installed. As far as I know, this is technically a breaking change, since older versions of the language plugins won't be supported. ## Anything else? I'm new here, so I may have missed something and other team members might have different perspectives. I think it would be helpful to discuss the future of `@eslint-community/eslint-plugin-eslint-comments`.
11 条评论