Skip to content

Commit 86fcbe4

Browse files
committed
Fix pre-commit: Add .pre-commit-config.yaml
- Add comprehensive pre-commit configuration file - Include hooks for file validation (trailing whitespace, end-of-file, etc.) - Add YAML validation for user profile files - Add Prettier formatting for JS, CSS, HTML, Markdown, YAML, JSON - Add Markdownlint for documentation quality - Exclude _site/, node_modules/, and package-lock.json Fixes #243
1 parent 17bb02d commit 86fcbe4

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.pre-commit-config.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Pre-commit configuration for NextCommunity.github.io
2+
# See https://pre-commit.com for more information
3+
4+
repos:
5+
# Standard pre-commit hooks for basic file checks
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.5.0
8+
hooks:
9+
- id: trailing-whitespace
10+
exclude: ^package-lock\.json$
11+
- id: end-of-file-fixer
12+
exclude: ^package-lock\.json$
13+
- id: check-yaml
14+
args: ["--unsafe"]
15+
- id: check-added-large-files
16+
args: ['--maxkb=1000']
17+
- id: check-json
18+
exclude: ^package-lock\.json$
19+
- id: check-merge-conflict
20+
- id: check-case-conflict
21+
- id: mixed-line-ending
22+
args: ['--fix=lf']
23+
24+
# Prettier for code formatting (JavaScript, CSS, HTML, Markdown, YAML, JSON)
25+
- repo: https://github.com/pre-commit/mirrors-prettier
26+
rev: v3.1.0
27+
hooks:
28+
- id: prettier
29+
types_or: [javascript, css, html, markdown, yaml, json]
30+
exclude: ^(package-lock\.json|_site/)
31+
additional_dependencies:
32+
- prettier@3.1.0
33+
34+
# Markdownlint for markdown files
35+
- repo: https://github.com/igorshubovych/markdownlint-cli
36+
rev: v0.39.0
37+
hooks:
38+
- id: markdownlint
39+
args: ['--fix']
40+
exclude: ^node_modules/
41+
42+
# Exclude patterns applied to all hooks
43+
exclude: |
44+
(?x)(
45+
^_site/|
46+
^node_modules/|
47+
^\.git/|
48+
package-lock\.json
49+
)

0 commit comments

Comments
 (0)