bmish / eslint-doc-generator

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

Support ESLint flat config #376

Open bmish opened 1 year ago

bmish commented 1 year ago

Need to investigate how close we can support plugins that export flat configs.

How can we detect flat configs exported by a plugin so we can determine which rules are part of which configs?

https://eslint.org/blog/2022/08/new-config-system-part-2/

bmish commented 9 months ago

Per https://github.com/eslint/eslint/issues/18095#issuecomment-1951414598, ideally plugins would continue to use the exported configs object to contain all their configs, both legacy and flat (temporarily using flat/ prefixes for flat configs before moving to -legacy suffixes for legacy configs). I'm not sure there's much we can or should do to detect flat configs that some plugins are exporting with string exports like eslint-plugin-example/configs/recommended. Plugins should eventually consolidate those back into the configs object.

We can update our README with documentation about this.

There's also a possibility that, using the configs object, we could detect the flat/legacy versions of the same config, and add some smart behavior to distinguish them.