47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
# https://taskfile.dev
|
|
|
|
version: '3'
|
|
|
|
tasks:
|
|
lint:fix:delta:
|
|
vars:
|
|
FILES:
|
|
sh: git diff-ls --diff-filter=d main | grep -v .vitebook
|
|
deps:
|
|
- task: 'lint:fix'
|
|
vars:
|
|
CLI_ARGS: '{{.FILES | catLines }}'
|
|
|
|
lint:
|
|
cmds:
|
|
- npx prettier --check {{.CLI_ARGS | default "." }}
|
|
- npx eslint {{.CLI_ARGS | default "." }}
|
|
|
|
lint:fix:
|
|
cmds:
|
|
- npx prettier --write {{.CLI_ARGS | default "." }}
|
|
- npx eslint --fix --quiet {{.CLI_ARGS | default "." }}
|
|
|
|
lint:delta:
|
|
cmds:
|
|
- task: 'lint:prettier:delta'
|
|
- task: 'lint:eslint:delta'
|
|
|
|
lint:prettier:delta:
|
|
vars:
|
|
FILES:
|
|
sh: git diff-ls --diff-filter=d {{.ROOT_BRANCH | default "main"}} | grep -v .vitebook
|
|
cmds:
|
|
- npx prettier --check {{.FILES | catLines }}
|
|
|
|
lint:eslint:delta:
|
|
vars:
|
|
FILES:
|
|
sh: git diff-ls --diff-filter=d {{.ROOT_BRANCH | default "main"}} | grep -v .vitebook
|
|
cmds:
|
|
- npx eslint --format=unix {{.FILES | catLines }}
|
|
|
|
lint:eslint:
|
|
cmds:
|
|
- npx eslint {{.FILES | default "src/**" }}
|