bmish / eslint-doc-generator

Automatic documentation generator for ESLint plugins and rules.
91 stars 5 forks source link

Support ESLint v9 #526

Open MikeMcC399 opened 4 months ago

MikeMcC399 commented 4 months ago

Request

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

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.

Related issues

MikeMcC399 commented 4 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 4 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 4 months ago

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

bmish commented 4 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 4 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.

MikeMcC399 commented 6 days 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.