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/.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/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 +} 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",