From a1b8c033cd43e4357c2079be386179fec26a86b8 Mon Sep 17 00:00:00 2001 From: scosman Date: Mon, 22 Jan 2024 00:24:32 -0500 Subject: [PATCH] Add format check command and CI --- .github/workflows/format.yml | 24 ++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..a8a7b15a --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,24 @@ +name: Format Check + +on: [push] + +env: + PUBLIC_SUPABASE_URL: 'https://fake_test_url.supabase.co' + PUBLIC_SUPABASE_ANON_KEY: 'fake_anon_key' + PRIVATE_SUPABASE_SERVICE_ROLE: 'fake_service_role' + PRIVATE_STRIPE_API_KEY: 'fake_strip_api_key' + PUBLIC_SITE_NAME: 'SaaS Starter Build Test' + +jobs: + build_and_test: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: NPM install + run: npm install + + - name: Check Code Format + run: npm run format_check diff --git a/package.json b/package.json index 94d198b2..c7f7a945 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch", "test": "vitest", "lint": "eslint .", - "format": "prettier --write --plugin prettier-plugin-svelte ./src" + "format": "prettier --write --plugin prettier-plugin-svelte ./src", + "format_check": "prettier --check --plugin prettier-plugin-svelte ./src" }, "devDependencies": { "@sveltejs/adapter-auto": "^2.0.0",