Skip to content

feat: add filtering by tag to "List of rules" page#2988

Open
twocaretcat wants to merge 2 commits into
denoland:mainfrom
twocaretcat:main
Open

feat: add filtering by tag to "List of rules" page#2988
twocaretcat wants to merge 2 commits into
denoland:mainfrom
twocaretcat:main

Conversation

@twocaretcat
Copy link
Copy Markdown

@twocaretcat twocaretcat commented Mar 20, 2026

There's a long list of lint rules on https://docs.deno.com/lint/ and no way to narrow them down by type aside from searching. This was really bothering me, so here's a PR that makes the existing rule set buttons filter the list.

It works with search (AND condition):

denoland-docs-2988-with-search

Multiple tags can be selected (OR condition):

denoland-docs-2988-multi-select

Styles for "pressed" buttons were lifted from the dark mode toggle button for consistent styling.

@twocaretcat twocaretcat marked this pull request as ready for review March 20, 2026 23:06
@twocaretcat
Copy link
Copy Markdown
Author

@bartlomieju do you need anything more from me here or can this be merged? I don't have perms to do so

Copy link
Copy Markdown
Contributor

@fibibot fibibot left a comment

Choose a reason for hiding this comment

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

Filtering reads data-tags={lintRule.tags.join(",")} from the generated lint-rule list and combines it with the existing #lint-rule-search query, so tag buttons do not change page URLs and empty-tag rules reappear when no filter is active. lint and link check is green.

@fibibot
Copy link
Copy Markdown
Contributor

fibibot commented May 17, 2026

@bartlomieju this is ready to merge

Copy link
Copy Markdown
Contributor

@lunadogbot lunadogbot left a comment

Choose a reason for hiding this comment

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

The tag buttons read the same lintRule.tags data already used for rule badges, and updateVisibility() combines the active tag set with the existing #lint-rule-search predicate instead of replacing it. Rules without tags reappear when no tag filter is active, CI is green, and deno task build:light completed locally.

@lunadogbot
Copy link
Copy Markdown
Contributor

@bartlomieju this is ready to merge

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.

4 participants