Skip to content

Commit

Permalink
feat: allow filter recommended rules, close #6
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Mar 31, 2024
1 parent 4164306 commit 92748ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composables/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const filtersRules = reactive({
plugin: '',
search: '',
state: 'using' as 'using' | 'unused' | 'overloads' | '',
status: 'active' as 'deprecated' | 'active' | '',
status: 'active' as 'deprecated' | 'active' | 'recommended' | '',
fixable: null as boolean | null,
})

Expand Down
7 changes: 5 additions & 2 deletions pages/rules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const conditionalFiltered = computed(() => {
case 'active':
conditional = conditional.filter(rule => !rule.deprecated)
break
case 'recommended':
conditional = conditional.filter(rule => rule.docs?.recommended)
break
case 'deprecated':
conditional = conditional.filter(rule => rule.deprecated)
break
Expand Down Expand Up @@ -114,8 +117,8 @@ function resetFilters() {
</div>
<OptionSelectGroup
v-model="filters.status"
:options="['', 'active', 'deprecated']"
:titles="['All', 'Active', 'Deprecated']"
:options="['', 'active', 'recommended', 'deprecated']"
:titles="['All', 'Active', 'Recommended', 'Deprecated']"
/>
</div>
</div>
Expand Down

0 comments on commit 92748ef

Please sign in to comment.