Skip to content

fix: detect rule prefix from ConfigsToRules and apply to rule doc title - #680

Open
y-hsgw wants to merge 4 commits into
eslint-community:mainfrom
y-hsgw:fix/prefix
Open

fix: detect rule prefix from ConfigsToRules and apply to rule doc title#680
y-hsgw wants to merge 4 commits into
eslint-community:mainfrom
y-hsgw:fix/prefix

Conversation

@y-hsgw

@y-hsgw y-hsgw commented Apr 12, 2025

Copy link
Copy Markdown
Contributor

This PR introduces a utility function detectPrefixFromConfigsToRules to infer the rule prefix by analyzing the rule IDs in ConfigsToRules, instead of relying on package.json.name.

Motivation

Currently, there's no single agreed-upon source for determining a plugin's rule prefix. It's unclear whether the most reliable approach is:

  • Reading from configs[configName].plugins
  • Inspecting configs[configName].rules
  • Or potentially something else entirely

So, as a first step, I've made a minimal change that applies this prefix detection only to the rule documentation title.

Future Scope

Depending on how the discussion evolves, I’m open to applying this logic more broadly across the codebase (e.g. for rule links, config listings, etc.).

If this approach is misaligned with expectations or future direction, I’m also totally fine with closing this PR.

Notes

Looking forward to your feedback!

@bmish

bmish commented Apr 23, 2025

Copy link
Copy Markdown
Member

Sorry about the delay. I've been busy and haven't had a chance to look yet, but hope to look soon, appreciate your work here.

@veritem

veritem commented Jun 23, 2025

Copy link
Copy Markdown

hey any update from maintainers?

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.

3 participants