Skip to content

Commit 09b7ddc

Browse files
authored
Merge pull request #232 from WebXDAO/krishguptadev/feature-replace-prettier-226
ci: automate eslint
2 parents e2dd914 + 5ce41c0 commit 09b7ddc

File tree

5 files changed

+52
-46
lines changed

5 files changed

+52
-46
lines changed

.github/workflows/autoprettier.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/lint.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Format
2+
on:
3+
push:
4+
paths:
5+
- 'public/data/**'
6+
7+
jobs:
8+
format:
9+
runs-on: ubuntu-latest
10+
name: Lint files
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
14+
with:
15+
node-version: '16'
16+
- run: npm ci
17+
- name: Lint
18+
run: npm run lint
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
- uses: stefanzweifel/git-auto-commit-action@v4
22+
with:
23+
commit_message: 'style: linted files'

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run lint

package-lock.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"start": "next start",
99
"lint": "next lint",
1010
"export": "next build && next export",
11-
"format": "npx prettier --write ."
11+
"prepare": "husky install"
1212
},
1313
"dependencies": {
1414
"@headlessui/react": "^1.7.1",
@@ -27,7 +27,8 @@
2727
"eslint": "8.6.0",
2828
"eslint-config-next": "12.3.0",
2929
"postcss": "^8.4.5",
30-
"tailwindcss": "^3.0.13"
30+
"tailwindcss": "^3.0.13",
31+
"husky": "^8.0.0"
3132
},
3233
"description": "WebXDAO website",
3334
"repository": {

0 commit comments

Comments
 (0)