Skip to content

Commit 42380be

Browse files
committed
docs: add es lint check
Signed-off-by: yuluo-yx <[email protected]>
1 parent 04782f4 commit 42380be

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.github/workflows/pre-commit.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ jobs:
2828
with:
2929
go-version: '1.24'
3030

31+
- name: Set up Node
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: '23'
35+
3136
- name: Set up Rust
3237
uses: dtolnay/rust-toolchain@stable
3338
with:
@@ -69,13 +74,14 @@ jobs:
6974
- name: Install pre-commit
7075
run: pip install pre-commit
7176

72-
- name: Run pre-commit on Go, Rust, and Python files
77+
- name: Run pre-commit on Go, Rust, JavaScript and Python files
7378
run: |
74-
# Find all Go, Rust, and Python files (excluding vendored/generated code)
75-
FILES=$(find . -type f \( -name "*.go" -o -name "*.rs" -o -name "*.py" \) \
79+
# Find all Go, Rust, JavaScripts and Python files (excluding vendored/generated code)
80+
FILES=$(find . -type f \( -name "*.go" -o -name "*.rs" -o -name "*.py" -o name "*.js" \) \
7681
! -path "./target/*" \
7782
! -path "./candle-binding/target/*" \
7883
! -path "./.git/*" \
84+
! -path "./node_modules/*" \
7985
! -path "./vendor/*" \
8086
! -path "./__pycache__/*" \
8187
! -path "./site/*" \
@@ -86,7 +92,7 @@ jobs:
8692
echo "Running pre-commit on files: $FILES"
8793
pre-commit run --files $FILES
8894
else
89-
echo "No Go, Rust, or Python files found to check"
95+
echo "No Go, Rust, JavaScript or Python files found to check"
9096
fi
9197
9298
- name: Show pre-commit results

.pre-commit-config.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ repos:
66
rev: v6.0.0
77
hooks:
88
- id: trailing-whitespace
9-
files: \.(go|rs|py)$
9+
files: \.(go|rs|py|js)$
1010
- id: end-of-file-fixer
11-
files: \.(go|rs|py)$
11+
files: \.(go|rs|py|js)$
1212
- id: check-added-large-files
1313
args: ['--maxkb=500']
14-
files: \.(go|rs|py)$
14+
files: \.(go|rs|py|js)$
1515

1616
# Go specific hooks
1717
- repo: local
@@ -22,6 +22,15 @@ repos:
2222
language: system
2323
files: \.go$
2424

25+
# JavaScript specific hooks
26+
- repo: local
27+
hooks:
28+
- id: js-lint
29+
name: js lint
30+
entry: npm run lint
31+
language: system
32+
files: \.js$
33+
2534
# Rust specific hooks
2635
- repo: local
2736
hooks:

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,11 @@ docs-serve: docs-build
215215
docs-clean:
216216
@echo "Cleaning documentation build artifacts..."
217217
cd website && npm run clear
218+
219+
docs-lint:
220+
@echo "Linting documentation..."
221+
cd website && npm run lint
222+
223+
docs-lint-fix:
224+
@echo "Fixing documentation lint issues..."
225+
cd website && npm run lint:fix

0 commit comments

Comments
 (0)