Skip to content

feat: receive plugin name via plugin metadata - #816

Merged
bmish merged 1 commit into
eslint-community:mainfrom
paescuj:feat/receive-plugin-name-via-plugin-meta
Nov 29, 2025
Merged

feat: receive plugin name via plugin metadata#816
bmish merged 1 commit into
eslint-community:mainfrom
paescuj:feat/receive-plugin-name-via-plugin-meta

Conversation

@paescuj

@paescuj paescuj commented Oct 29, 2025

Copy link
Copy Markdown
Contributor

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.name field. If this isn't defined, it falls back to the current method of using the name field of the plugin's package.json file.

Most plugins have <plugin>.meta.name set to the same value as the package name.
Some prominent examples would be: vue, markdown, unicorn, ...
In these cases, eslint-doc-generator will work exactly as before.

For plugins having a value at <plugin>.meta.name that 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-generator will 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

@bmish

bmish commented Oct 29, 2025

Copy link
Copy Markdown
Member

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.

@paescuj
paescuj force-pushed the feat/receive-plugin-name-via-plugin-meta branch from 740b081 to 49da73c Compare October 29, 2025 14:50
@bmish

bmish commented Oct 29, 2025

Copy link
Copy Markdown
Member

Would you be able to test this with the plugins mentioned in the description?

@paescuj

paescuj commented Oct 29, 2025

Copy link
Copy Markdown
Contributor Author

@bmish Thank you for your quick and positive response! I'll perform some tests and report back to you 👍

@bmish bmish left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to merge for now. If it causes issues, we can revert.

@bmish
bmish merged commit 712417b into eslint-community:main Nov 29, 2025
13 checks passed
@bmish bmish changed the title feat: receive plugin name via plugin meta data feat: receive plugin name via plugin metadata Nov 29, 2025
@paescuj
paescuj deleted the feat/receive-plugin-name-via-plugin-meta branch November 29, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation not generated when package.json name prefix and Config name mismatch

2 participants