File tree Expand file tree Collapse file tree 1 file changed +31
-8
lines changed
packages/web/src/routes/docs/rules Expand file tree Collapse file tree 1 file changed +31
-8
lines changed Original file line number Diff line number Diff line change 1
1
<script module lang =" ts" >
2
- import { LocalLinter } from ' harper.js' ;
2
+ import { LocalLinter , type LintConfig } from ' harper.js' ;
3
+ import {
4
+ Table ,
5
+ TableBody ,
6
+ TableBodyCell ,
7
+ TableBodyRow ,
8
+ TableHead ,
9
+ TableHeadCell
10
+ } from ' flowbite-svelte' ;
3
11
4
12
export const prerender = true ;
5
13
export const frontmatter = {
6
14
title: ' Rules'
7
15
};
8
16
9
- let info: Record <string , string > = $state ({});
17
+ let descriptions: Record <string , string > = $state ({});
18
+ let default_config: LintConfig = $state ({});
10
19
11
20
let linter = new LocalLinter ();
12
21
linter .getLintDescriptions ().then (async (v ) => {
13
- info = v ;
14
- console .log (v );
22
+ descriptions = v ;
23
+ });
24
+ linter .getDefaultLintConfig ().then (async (v ) => {
25
+ default_config = v ;
15
26
});
16
27
</script >
17
28
18
29
<p >This page is an incomplete list of the various grammatical rules Harper checks for.</p >
19
30
20
- {#each Object .entries (info ) as [name, description]}
21
- <h2 >{name }</h2 >
22
- <p >{description }</p >
23
- {/each }
31
+ <Table >
32
+ <TableHead >
33
+ <TableHeadCell >Name</TableHeadCell >
34
+ <TableHeadCell >Enabled by Default</TableHeadCell >
35
+ <TableHeadCell >Description</TableHeadCell >
36
+ </TableHead >
37
+ <TableBody >
38
+ {#each Object .entries (descriptions ) as [name, description]}
39
+ <TableBodyRow >
40
+ <TableBodyCell >{name }</TableBodyCell >
41
+ <TableBodyCell >{default_config [name ] ? ' ✔️' : ' ❌' }</TableBodyCell >
42
+ <TableBodyCell tdClass ="px-6 py-4 font-medium" >{description }</TableBodyCell >
43
+ </TableBodyRow >
44
+ {/each }
45
+ </TableBody >
46
+ </Table >
You can’t perform that action at this time.
0 commit comments