-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
64 lines (58 loc) · 1.86 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
64 lines (58 loc) · 1.86 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
repos:
# Basic file hygiene and validation
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
description: Trim trailing whitespace
- id: end-of-file-fixer
description: Ensure files end with newline
- id: check-json
description: Check JSON syntax
- id: check-yaml
description: Check YAML syntax
- id: check-merge-conflict
description: Check for merge conflicts
- id: check-added-large-files
args: ['--maxkb=1000']
description: Prevent large files from being committed
# Local hooks using existing npm scripts
- repo: local
hooks:
# Prettier formatting (auto-fix)
- id: prettier
name: Prettier Format
description: Format code with Prettier
entry: npm run format
language: system
files: \.(ts|js|json|md)$
pass_filenames: false
# ESLint linting
- id: eslint
name: ESLint
description: Lint TypeScript files with ESLint
entry: npm run lint
language: system
files: \.ts$
pass_filenames: false
# TypeScript compilation check
- id: typescript
name: TypeScript Check
description: Check TypeScript types
entry: npx tsc --noEmit
language: system
files: \.ts$
pass_filenames: false
# Optional: Run tests on changed files
# Uncomment if you want to run tests before commit
# - id: vitest
# name: Vitest Tests
# description: Run tests on affected files
# entry: npm run test
# language: system
# files: \.(ts|js)$
# pass_filenames: false
# Optional: Configure default hooks behavior
default_stages: [pre-commit]
# Optional: Configure which hooks to run on which stages
# stages: [commit, push, manual]