Skip to content

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

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
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

y-hsgw
Copy link
Contributor

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

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
Copy link
Owner

bmish commented Apr 23, 2025

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.

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.

2 participants