Skip to content

Conversation

jaymarvelz
Copy link

@jaymarvelz jaymarvelz commented Aug 28, 2025

Prerequisites checklist

What is the purpose of this pull request?

This PR adds a new allowLabels option to no-missing-label-refs, allowing users to intentionally permit specific labels without definitions.

What changes did you make? (Give an overview)

  • Updated the rule logic to skip reporting missing references whose labels are listed in allowLabels.
  • Documented the option with example configuration and usage.
  • Added tests to cover valid ignores and non-ignored labels still reporting.

Related Issues

Fixes #449

Is there anything you'd like reviewers to focus on?

@lumirlumir
Copy link
Member

Thanks for working on it.

Just one thought: Would anyone be open to renaming the option to allowLabels here?

Since most rules in markdown use allow for array option names, I think this change would help make the option names more consistent.

allowDefinitions: ["//"],
allowFootnoteDefinitions: [],

allowDefinitions: ["//"],
allowFootnoteDefinitions: [],

allowed: [],

allowDefinitions: ["//"],
allowFootnoteDefinitions: [],

@jaymarvelz
Copy link
Author

Yeah, that makes sense 👍. I went ahead and updated the option name.

@jaymarvelz jaymarvelz changed the title feat: add ignoreLabels option to no-missing-label-refs feat: add allowLabels option to no-missing-label-refs Aug 29, 2025

The following options are available on this rule:

* `allowLabels: Array<string>` - labels to allow when checking for missing label references. (default: `[]`)
Copy link
Member

Choose a reason for hiding this comment

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

In your original issue you mentioned wanting to use ignoreLabels. Why the change?

Copy link
Author

Choose a reason for hiding this comment

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

I initially called it ignoreLabels, but @lumirlumir suggested being consistent with other rules, so I renamed it. Would you like me to revert the change?

Copy link
Member

Choose a reason for hiding this comment

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

I've asked @jaymarvelz (and other team members) for their opinion on #513 (comment), how about renaming it to allow for consistency across the Markdown rules.

If you feel ignore is more appropriate here, please disregard my suggestion and feel free to keep ignore.

Copy link
Contributor

Choose a reason for hiding this comment

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

allowLabels amkes sense to me 👍🏻

@nzakas nzakas moved this from Needs Triage to Implementing in Triage Aug 29, 2025
lumirlumir
lumirlumir previously approved these changes Aug 30, 2025
Copy link
Member

@lumirlumir lumirlumir left a comment

Choose a reason for hiding this comment

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

Looks so good to me. Thanks 👍

Would like @nzakas to verify (including the option name) before merging.

@lumirlumir lumirlumir moved this from Implementing to Second Review Needed in Triage Aug 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Second Review Needed
Development

Successfully merging this pull request may close these issues.

Rule Change: new ignoredLabels option for no-missing-label-refs
4 participants