ci: add GitHub Action for prettier format check
Add format-check workflow that runs prettier --check across all packages on push/PR to main/develop branches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
name: Format Check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
paths:
|
||||
- '**.ts'
|
||||
- '**.tsx'
|
||||
- '**.js'
|
||||
- '**.jsx'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'package.json'
|
||||
- 'packages/*/package.json'
|
||||
- 'shared/*/package.json'
|
||||
- '.prettierrc'
|
||||
- '.prettierrc.*'
|
||||
- '.prettierignore'
|
||||
- '.github/workflows/format-check.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.ts'
|
||||
- '**.tsx'
|
||||
- '**.js'
|
||||
- '**.jsx'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'package.json'
|
||||
- 'packages/*/package.json'
|
||||
- 'shared/*/package.json'
|
||||
- '.prettierrc'
|
||||
- '.prettierrc.*'
|
||||
- '.prettierignore'
|
||||
- '.github/workflows/format-check.yml'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: 'bash'
|
||||
|
||||
jobs:
|
||||
format-check:
|
||||
name: Prettier Format Check
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Run format check
|
||||
run: pnpm run format:check
|
||||
@@ -0,0 +1,9 @@
|
||||
node_modules
|
||||
dist
|
||||
build
|
||||
coverage
|
||||
.next
|
||||
.vite
|
||||
*.min.js
|
||||
*.min.css
|
||||
pnpm-lock.yaml
|
||||
+3
-2
@@ -25,7 +25,7 @@
|
||||
"tenants:seed:latest": "lerna run cli:tenants:seed:latest --scope \"@bigcapital/server\"",
|
||||
"generate:sdk-types": "lerna run openapi:export --scope \"@bigcapital/server\" && lerna run generate --scope \"@bigcapital/sdk-ts\" && lerna run build --scope \"@bigcapital/sdk-ts\"",
|
||||
"format": "lerna run format",
|
||||
"format:check": "lerna run format:check"
|
||||
"format:check": "prettier --check 'packages/*/src/**/*.{ts,tsx,js,jsx}' 'shared/*/src/**/*.{ts,tsx,js,jsx}'"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^17.4.2",
|
||||
@@ -35,7 +35,8 @@
|
||||
"@playwright/test": "^1.32.3",
|
||||
"husky": "^8.0.3",
|
||||
"lerna": "^8.1.2",
|
||||
"pnpm": "^9.0.5"
|
||||
"pnpm": "^9.0.5",
|
||||
"prettier": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "16.x || 17.x || 18.x"
|
||||
|
||||
Reference in New Issue
Block a user