chore: add markdownlint and expand prettier pre-commit scope
This commit is contained in:
@@ -13,6 +13,14 @@ repos:
|
||||
- id: check-toml
|
||||
- id: mixed-line-ending
|
||||
|
||||
# Markdown linting
|
||||
- repo: https://github.com/igorshubovych/markdownlint-cli
|
||||
rev: v0.45.0
|
||||
hooks:
|
||||
- id: markdownlint
|
||||
args: [--fix]
|
||||
files: \.(md|markdown)$
|
||||
|
||||
# TOML linting
|
||||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
|
||||
rev: v2.14.0
|
||||
@@ -86,10 +94,10 @@ repos:
|
||||
# Prettier with auto-format for pre-commit (CI uses --check)
|
||||
- id: prettier
|
||||
name: prettier
|
||||
entry: bash -c 'export PATH="$HOME/.local/share/mise/shims:$HOME/.local/bin:$PATH" && cd frontend && if [ "${CI:-}" = "true" ]; then corepack yarn prettier --check src/; else corepack yarn prettier --write src/; fi'
|
||||
entry: bash -c 'export PATH="$HOME/.local/share/mise/shims:$HOME/.local/bin:$PATH" && FILES=(); for file in "$@"; do FILES+=("$(realpath "$file")"); done && if [ "${CI:-}" = "true" ]; then corepack yarn --cwd frontend prettier --check "${FILES[@]}"; else corepack yarn --cwd frontend prettier --write "${FILES[@]}"; fi' --
|
||||
language: system
|
||||
files: ^frontend/.*\.(js|ts|vue|json|css|scss|md)$
|
||||
pass_filenames: false
|
||||
files: \.(js|ts|vue|json|css|scss|md|markdown)$
|
||||
pass_filenames: true
|
||||
|
||||
# TypeScript type checking (same as CI)
|
||||
- id: typescript-check
|
||||
|
||||
Reference in New Issue
Block a user