From 1dc743cf4deffb4ac8199c8b48c627d73e277f64 Mon Sep 17 00:00:00 2001 From: nclsndr Date: Tue, 10 Feb 2026 15:28:45 +0100 Subject: [PATCH 1/2] chore: format with prettier --- .github/workflows/demo-strapi-version-check.yml | 1 - demo/.strapi-app/package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/demo-strapi-version-check.yml b/.github/workflows/demo-strapi-version-check.yml index be89143..c411c85 100644 --- a/.github/workflows/demo-strapi-version-check.yml +++ b/.github/workflows/demo-strapi-version-check.yml @@ -93,4 +93,3 @@ jobs: labels: | dependencies automated - diff --git a/demo/.strapi-app/package.json b/demo/.strapi-app/package.json index e2d80f7..e961359 100644 --- a/demo/.strapi-app/package.json +++ b/demo/.strapi-app/package.json @@ -36,4 +36,4 @@ "strapi": { "uuid": "getstarted" } -} \ No newline at end of file +} From 2e021d99c00db9cf4eea730f0869eabdae424119 Mon Sep 17 00:00:00 2001 From: nclsndr Date: Tue, 10 Feb 2026 15:42:46 +0100 Subject: [PATCH 2/2] chore: improve formatting and linting guardrails for pre-commit and CI --- .github/workflows/tests.yml | 46 +++++++++++++++++++++++++++++++++++++ .husky/pre-commit | 1 + .lintstagedrc | 2 +- package.json | 5 ++-- 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e4e6a0b..a3bc811 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,6 +33,52 @@ jobs: with: node-version: ${{ matrix.node }} + lint: + name: 'Check linting' + needs: [cache-and-install] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + version: 9.1.0 + run_install: true + + - name: Install Node.js + uses: actions/setup-node@v6 + with: + node-version: 20 + cache: 'pnpm' + + - name: Lint + run: pnpm run lint + + format: + name: 'Check formatting' + needs: [cache-and-install] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + version: 9.1.0 + run_install: true + + - name: Install Node.js + uses: actions/setup-node@v6 + with: + node-version: 20 + cache: 'pnpm' + + - name: Format check + run: pnpm run format:check + build: name: 'build (node: ${{ matrix.node }})' needs: [cache-and-install] diff --git a/.husky/pre-commit b/.husky/pre-commit index 588c59f..5f11506 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1,4 @@ npx --no-install lint-staged +pnpm run format:check pnpm run ts:check pnpm run test:coverage diff --git a/.lintstagedrc b/.lintstagedrc index 505b9f6..b1e5b51 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,3 +1,3 @@ { - "{src,tests}/**/*.{js,ts,jsx,tsx,yml,yaml}": ["pnpm run prettier:write", "pnpm run lint:fix"] + "{src,tests}/**/*.{js,ts,jsx,tsx,yml,yaml}": ["pnpm run format:write", "pnpm run lint:fix"] } diff --git a/package.json b/package.json index 457bf88..fd2a3b3 100644 --- a/package.json +++ b/package.json @@ -55,8 +55,9 @@ "lint:fix": "eslint . --fix", "lint:fix:dry": "eslint . --fix-dry-run", "prepare": "husky", - "prettier:check": "prettier --check .", - "prettier:write": "prettier --write .", + "format": "prettier --write .", + "format:write": "prettier --write .", + "format:check": "prettier --check .", "test": "vitest run", "test:coverage": "vitest run --coverage", "ts:check": "tsc -p tsconfig.build.json --noEmit",