name: Lint, format & type check
on:
  pull_request: {}
jobs:
  prettier:
    name: Lint, format & type check
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
        with:
          persist-credentials: false
      - name: Enable Corepack
        run: corepack enable
      - name: pnpm cache
        uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
        with:
          cache: "pnpm"
          node-version-file: ".node-version"
      - name: Install dependencies
        # ignore-pnpmfile should never be commited. Make CI crash if it happened (`pnpmfileChecksum` is present)
        run: "pnpm install --frozen-lockfile --ignore-pnpmfile"
      - name: Prettier
        run: "pnpm run prettier:check"
      - name: i18n
        run: "pnpm run i18n:check"
      - name: ESLint
        run: "pnpm run lint:eslint"
      - name: Type check
        run: "pnpm run lint:types"
      - name: Dead code analysis
        run: "pnpm run lint:knip"
