Skip to content

Commit b37a8a6

Browse files
Namcheeantfu
andauthored
feat: add auto fix indicator on rule list (#180)
Co-authored-by: Anthony Fu <[email protected]>
1 parent 330a859 commit b37a8a6

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

docs/.vitepress/components/RuleItem.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ const shortId = computed(() => props.package.shortId)
2020
</a>
2121
</td>
2222
<td>{{ rule.meta?.docs?.description }}</td>
23+
<td :title="rule.meta?.fixable ? 'This rule has an auto-fix' : ''">
24+
{{ rule.meta?.fixable ? '🔧' : '' }}
25+
</td>
2326
</tr>
2427
</template>

docs/.vitepress/components/RuleList.vue

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,29 @@ const pkg = packages.find(p => p.shortId === props.package)!
99
</script>
1010

1111
<template>
12+
<p>Each rule has emojis denoting:</p>
13+
<div flex="~ items-center gap-2" border="~ solid gray/10 rounded" p3>
14+
<code w-1.9em h-1.9em>🔧</code>
15+
<div flex="~ items-center gap-2 wrap">
16+
Some problems reported are fixable by the <code>--fix</code> command line option
17+
</div>
18+
</div>
1219
<table>
13-
<RuleItem
14-
v-for="rule of pkg.rules"
15-
:key="rule.name"
16-
:rule="rule"
17-
:package="pkg"
18-
/>
20+
<thead>
21+
<tr>
22+
<td>Rule</td>
23+
<td>Description</td>
24+
<td></td>
25+
</tr>
26+
</thead>
27+
28+
<tbody>
29+
<RuleItem
30+
v-for="rule of pkg.rules"
31+
:key="rule.name"
32+
:rule="rule"
33+
:package="pkg"
34+
/>
35+
</tbody>
1936
</table>
2037
</template>

0 commit comments

Comments
 (0)