Skip to content

Commit 617c64e

Browse files
committed
add github workflow to linting the project
1 parent 81d4a85 commit 617c64e

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/linting.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint Project
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
env:
8+
CI: true
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
lint:
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- uses: actions/checkout@v5
19+
- name: Set up Node
20+
uses: actions/setup-node@v6
21+
with:
22+
node-version: 24
23+
- name: Install dependencies
24+
run: npm ci
25+
- name: Lint project
26+
run: lefthook run pre-commit --all-files

lefthook.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# https://lefthook.dev/configuration/
33
pre-commit:
44
jobs:
5-
- run: npx eslint --fix "{staged_files}"
5+
- run: npx eslint --fix --max-warnings 0 "{staged_files}"
66
glob: "*.{js,jsx,ts,tsx}"
77
stage_fixed: true
88

9-
- run: npx stylelint --fix "{staged_files}"
9+
- run: npx stylelint --fix --max-warnings 0 "{staged_files}"
1010
glob: "*.css"
1111
stage_fixed: true
1212

0 commit comments

Comments
 (0)