-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile.codestyle
46 lines (35 loc) · 1.01 KB
/
justfile.codestyle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
## Formatting and Linting
## Scripts related to formatting code
default_lang := 'all'
# Can lint 'ts', 'md', or 'all'. Defaults to all
[group('codestyle')]
lint lang=default_lang:
@just _lint-{{lang}}
# lint and fix issues that can be fixed. pass "unsafe" to also apply unsafe fixes.
[group('codestyle')]
lint-ts-apply unsafe='':
cd web; npm run lint-apply{{ if unsafe == "unsafe" { "-unsafe" } else { "" } }} && npm run check-apply{{ if unsafe == "unsafe" { "-unsafe" } else { "" } }}
alias l := lint
@_lint-all:
-just _lint-md
-just _lint-ts
[no-exit-message]
_lint-md:
docker run --rm -v $PWD:/workdir davidanson/markdownlint-cli2:v0.8.1 \
"**/*.md" \
"#web/node_modules" \
"#functions/node_modules" \
"#codebase.md"
[no-exit-message]
_lint-ts:
cd web; npm run lint && npm run check
# Can format 'ts', 'md', or 'all'. Defaults to all
[group('codestyle')]
fmt lang=default_lang:
@just _fmt-{{lang}}
alias f := fmt
_fmt-all:
@just _fmt-ts
[no-exit-message]
_fmt-ts:
cd web; npm run format