diff --git a/.github/workflows/format_check.yml b/.github/workflows/format_check.yml new file mode 100644 index 0000000..2d954bf --- /dev/null +++ b/.github/workflows/format_check.yml @@ -0,0 +1,27 @@ +name: Format Check + +on: + push: + branches: + - main + - format_ca + pull_request: + branches: + - main + - format_ca + +jobs: + prettier-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up Node.js and pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Format check on react-todo + run: cd packages/react-todo && pnpm install && pnpm run check \ No newline at end of file diff --git a/packages/react-todo/package.json b/packages/react-todo/package.json index 8e53efb..fca5f9b 100644 --- a/packages/react-todo/package.json +++ b/packages/react-todo/package.json @@ -8,7 +8,8 @@ "build": "vite build", "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", - "format": "pnpm exec -- npx prettier --write ." + "format": "pnpm exec -- npx prettier --write .", + "check": "pnpm exec -- npx prettier --check ." }, "dependencies": { "react": "^18.2.0", @@ -25,4 +26,4 @@ "prettier": "^3.0.1", "vite": "^4.4.5" } -} +} \ No newline at end of file diff --git a/packages/svelte-todo/package.json b/packages/svelte-todo/package.json index 646d184..a19cfb8 100644 --- a/packages/svelte-todo/package.json +++ b/packages/svelte-todo/package.json @@ -11,6 +11,7 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "lint": "prettier --plugin-search-dir . --check . && eslint .", "format": "prettier --plugin-search-dir . --write .", + "prettier:check": "pnpm exec -- npx prettier --plugin-search-dir . --check .", "test:integration": "playwright test", "test:unit": "vitest" }, @@ -33,4 +34,4 @@ "vitest": "^0.32.2" }, "type": "module" -} +} \ No newline at end of file diff --git a/packages/vanilla-todo/package.json b/packages/vanilla-todo/package.json index 508c98c..e00ac88 100644 --- a/packages/vanilla-todo/package.json +++ b/packages/vanilla-todo/package.json @@ -7,9 +7,10 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "format": "pnpm exec -- npx prettier --write ." + "format": "pnpm exec -- npx prettier --write .", + "check": "pnpm exec -- npx prettier --check ." }, "devDependencies": { "vite": "^4.4.5" } -} +} \ No newline at end of file diff --git a/packages/vue-todo/package.json b/packages/vue-todo/package.json index 3edd80c..c121316 100644 --- a/packages/vue-todo/package.json +++ b/packages/vue-todo/package.json @@ -7,7 +7,8 @@ "dev": "vite", "build": "vue-tsc && vite build", "preview": "vite preview", - "format": "pnpm exec -- npx prettier --write ." + "format": "pnpm exec -- npx prettier --write .", + "check": "pnpm exec -- npx prettier --check ." }, "dependencies": { "vue": "^3.3.4" @@ -18,4 +19,4 @@ "vite": "^4.4.5", "vue-tsc": "^1.8.5" } -} +} \ No newline at end of file