Skip to content

Confusing ![badge-legacy-recommended][] added to rules list table #674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JoshuaKGoldberg opened this issue Apr 7, 2025 · 2 comments
Open

Comments

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Apr 7, 2025

In JoshuaKGoldberg/eslint-plugin-package-json#993, every recommended rule in the generated rules list table is adding a ![badge-legacy-recommended][] next to its βœ… emoji. I have no idea why:

- | Name                                             | Description                                      | πŸ’Ό                              | πŸ”§ | πŸ’‘ | ❌  |
- | :------------------------------------------------| :----------------------------------------------- | :------------------------------ | :- | :- | :- |
- | [no-empty-fields](docs/rules/no-empty-fields.md) | Reports on unnecessary empty arrays and objects. | βœ… ![badge-legacy-recommended][] |    | πŸ’‘ |    |

Sorry I don't have a more isolated reproduction, I'm a bit swamped at the moment πŸ˜…. But you can reproduce that PR with:

gh repo clone https://github.com/JoshuaKGoldberg/eslint-plugin-package-json
cd eslint-plugin-package-json
gh pr checkout 993
pnpm i
pnpm build:docs

Edit: I think it's that the package exports a legacy-recommended config that doesn't have a default emoji. But this is a confusing experience as an end-user.

Proposal: can there beΒ either some indication of why the invalid markdown is being added? Maybe a console warning?

@JoshuaKGoldberg JoshuaKGoldberg changed the title ![badge-legacy-recommended][] added to rules list table Confusing ![badge-legacy-recommended][] added to rules list table Apr 7, 2025
@bmish
Copy link
Owner

bmish commented Apr 11, 2025

Currently, markdown badges will be used when a config doesn't have an emoji specified (many common configs have default emojis specified). Note that you still have to define the image used for the badge elsewhere in your markdown file for it to render properly. More info: https://github.com/bmish/eslint-doc-generator?tab=readme-ov-file#badges

I have an issue to fix this confusing behavior so that any badge usage would be explicit and not used by default, since we recommend using emojis instead badges:

@JoshuaKGoldberg
Copy link
Contributor Author

Cool that makes sense, thanks! Is the resolution that this should just be closed out? Alternately, if it's a long time until breaking changes can land, I wouldn't mind sending the PR to add a warning just to have the code deleted eventually.

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

No branches or pull requests

2 participants