bmish / eslint-doc-generator

Automatic documentation generator for ESLint plugins and rules.
92 stars 7 forks source link

Support ESLint v9 #526

Open MikeMcC399 opened 6 months ago

MikeMcC399 commented 6 months ago

Request

This is a request for the eslint-doc-generator to support usage in an ESLint v9 environment.

Installing should produce no warnings.

Why it's needed

ESLint v9 is the current version. eslint-doc-generator assists in generating standardized documentation sections independently of plugin authors. This is possible on ESLint v8 and earlier versions.

It would be beneficial to users of plugins working under ESLint v9 to have support for this version. This would enable a continued high standard of plugin documentation information available.

Edit: Since Oct 5, 2024 ESLint v9 is the lowest supported version of ESLint - see https://eslint.org/version-support/.

Related issues

MikeMcC399 commented 6 months ago

In the meantime it may be a good idea to add a note to the README concerning the status with ESLint v9.

Currently there is no restriction for ESLint v9 in the repo according to package.json:

https://github.com/bmish/eslint-doc-generator/blob/01c317934c386f699c5eb5f912c6c6b0436201b9/package.json#L86-L88

bmish commented 6 months ago

I would like to make sure we work with ESLint v9. However, I'm not actually sure of any ESLint v9 specific issues.

The peer dependency issue in #525 is not really specific to ESLint v9.

Besides that, is there any actual problem using it with ESLint v9?

ljharb commented 6 months ago

since eslint 9 defaults to flat config, i assume #376 is a blocker

bmish commented 6 months ago

I haven't really identified a specific blocker with flat configs. That issue was more intended to investigate whether flat configs will need additional work to support. As long as flat configs are exported from plugins using the existing configs object, we should be able to identify them. The problem is, many plugins are exporting flat configs only via string exports (const recommended = require('eslint-plugin-foo/configs/recommended');), and that isn't detectable really. Discussed more in https://github.com/eslint/eslint/issues/18095.

MikeMcC399 commented 6 months ago

@bmish

Hello again 😄

Same confirmation steps as before, running under Windows 11, except updated to ESLint 9.2.0.

git clone https://github.com/cypress-io/eslint-plugin-cypress
cd eslint-plugin-cypress
npm ci
npm install eslint@9 eslint-doc-generator@1.7.1 -D
npx eslint-doc-generator

No errors apart from the peer dependency warning with npm install.

Edit: This is outdated, since in the meantime eslint-plugin-cypress@4.0.0 uses eslint@9 as minimum

MikeMcC399 commented 2 months ago

@bmish

Are you going to pick this up some time? I see that https://typescript-eslint.io/blog/announcing-typescript-eslint-v8 brings in ESLint v9 support and that was one of the blockers.

MikeMcC399 commented 1 month ago

Installing eslint-doc-generator produces several deprecation warnings including

npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

Subsequent npm ci shows:

$ npm ci
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @typescript-eslint/utils@5.62.0
npm warn Found: eslint@9.12.0
npm warn node_modules/eslint
npm warn   dev eslint@"^9.12.0" from the root project
npm warn   8 more (@eslint-community/eslint-utils, eslint-compat-utils, ...)
npm warn
npm warn Could not resolve dependency:
npm warn peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0" from @typescript-eslint/utils@5.62.0
npm warn node_modules/eslint-doc-generator/node_modules/@typescript-eslint/utils
npm warn   @typescript-eslint/utils@"^5.38.1" from eslint-doc-generator@1.7.1
npm warn   node_modules/eslint-doc-generator
npm warn
npm warn Conflicting peer dependency: eslint@8.57.1
npm warn node_modules/eslint
npm warn   peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0" from @typescript-eslint/utils@5.62.0
npm warn   node_modules/eslint-doc-generator/node_modules/@typescript-eslint/utils
npm warn     @typescript-eslint/utils@"^5.38.1" from eslint-doc-generator@1.7.1
npm warn     node_modules/eslint-doc-generator
MikeMcC399 commented 1 month ago

@bmish

bmish commented 1 month ago

@MikeMcC399 yes I am open to contributions so please continue filing issues/PRs with any suggestions. I am busy traveling recently but would like to get things updated/modernized in this repository in the coming months, and any help is welcome.

MikeMcC399 commented 1 month ago

@bmish

Thanks very much for your positive reply! I'll make a start by highlighting some suggestions and I'll submit PRs as far as I am able to do.

MikeMcC399 commented 1 month ago

@bmish