-
Notifications
You must be signed in to change notification settings - Fork 13
36 lines (29 loc) · 1.22 KB
/
prettier.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Code Formatting
on:
pull_request:
branches: ['**']
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '21.1.0'
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Dependencies
run: pnpm install
- name: List files to be checked
run: |
echo "Files to be checked:"
find . -type f \( -name "*.js" -o -name "*.jsx" -o -name "*.ts" -o -name "*.tsx" -o -name "*.md" -o -name "*.json" -o -name "*.css" -o -name "*.scss" -o -name "*.yaml" -o -name "*.yml" \) -not -path "./node_modules/*" -not -path "./.next/*"
- name: Check Formatting
run: |
echo "Running Prettier check..."
pnpm exec prettier --config prettier.config.js --check "**/*.{js,jsx,ts,tsx,md,json,css,scss,yaml,yml}" || (
echo "❌ Prettier found style issues in the above files"
echo "To fix these issues, run: pnpm format"
exit 1
)