Skip to content

Commit 7c5cb11

Browse files
committed
enforced precommit for prettier, added prettier to github actions
1 parent 8dad131 commit 7c5cb11

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Run Prettier on
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
prettier:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: '20'
17+
18+
- name: Cache dependencies
19+
uses: actions/cache@v3
20+
with:
21+
path: ~/.npm
22+
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
23+
restore-keys: |
24+
${{ runner.OS }}-node-
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run Prettier check
30+
run: npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,scss,md,html,yml,yaml}"

0 commit comments

Comments
 (0)