Skip to content

Commit 28fb22c

Browse files
committed
chore: add prettier for code formatting
- add .prettierrc with project style rules - add format and format:check scripts to package.json - add format check step to PR workflow
1 parent 7a9b519 commit 28fb22c

File tree

4 files changed

+2424
-2391
lines changed

4 files changed

+2424
-2391
lines changed

.github/workflows/pr-checks.yml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
name: PR Checks
22

33
on:
4-
pull_request:
5-
branches: [master, dev]
4+
pull_request:
5+
branches: [master, dev]
66

77
jobs:
8-
validate:
9-
name: Type Check, Build & Audit
10-
runs-on: ubuntu-latest
11-
12-
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v4
15-
16-
- name: Setup Node.js
17-
uses: actions/setup-node@v4
18-
with:
19-
node-version: '20'
20-
cache: 'npm'
21-
22-
- name: Install dependencies
23-
run: npm ci
24-
25-
- name: Type check
26-
run: npm run typecheck
27-
28-
- name: Build
29-
run: npm run build
30-
31-
- name: Security audit
32-
run: npm audit --audit-level=high
33-
continue-on-error: false
8+
validate:
9+
name: Type Check, Build & Audit
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: "20"
20+
cache: "npm"
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Format check
26+
run: npm run format:check
27+
28+
- name: Type check
29+
run: npm run typecheck
30+
31+
- name: Build
32+
run: npm run build
33+
34+
- name: Security audit
35+
run: npm audit --audit-level=high
36+
continue-on-error: false

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"semi": false,
3+
"singleQuote": false,
4+
"tabWidth": 4,
5+
"useTabs": false,
6+
"trailingComma": "all",
7+
"printWidth": 100,
8+
"bracketSpacing": true,
9+
"arrowParens": "always"
10+
}

0 commit comments

Comments
 (0)