feat: receive plugin name via plugin metadata - #816
Conversation
|
This looks like a good fix. To confirm, it sounds like it won't affect most plugins, and it should fix eslint-doc-generator for a small number of plugins like vitest that haven't been able to use it yet. To confirm, we aren't aware of any situations where this will break existing users, right? If that's right, I'm open to releasing it as a bug fix. If there are more concerns, and if this is still the right fix, then I'm also open to doing a major release with it in the near future. CC: @y-hsgw this looks like a simpler fix for your issue with vitest. |
740b081 to
49da73c
Compare
|
Would you be able to test this with the plugins mentioned in the description? |
|
@bmish Thank you for your quick and positive response! I'll perform some tests and report back to you 👍 |
bmish
left a comment
There was a problem hiding this comment.
I'm going to merge for now. If it causes issues, we can revert.
This is another (see #680), rather simple approach to solve cases as outlined in #610.
It works by trying to get the plugin name from the
<plugin>.meta.namefield. If this isn't defined, it falls back to the current method of using thenamefield of the plugin'spackage.jsonfile.Most plugins have
<plugin>.meta.nameset to the same value as the package name.Some prominent examples would be: vue, markdown, unicorn, ...
In these cases,
eslint-doc-generatorwill work exactly as before.For plugins having a value at
<plugin>.meta.namethat differs from the package name, this is either a way resp. indicator that the rules should be prefixed with that varying value, or is it already the shorthand (package name:eslint-plugin-x, meta name:x). In the latter case,eslint-doc-generatorwill again produce exactly the same result as before.In the first case, it would help to achieve the desired result for the docs (as described in #610) without having to introduce a new option.
Examples would be: vitest, antfu, ...
I feel like this approach might not even be considered as a breaking change (although I'd still leave a corresponding note in the changelog).
Fixes #610
BEGIN_COMMIT_OVERRIDE
feat: receive plugin name via plugin metadata
END_COMMIT_OVERRIDE