name: format-check

"on":
  pull_request:
    branches: ["**"]

jobs:
  prettier:
    runs-on: ubuntu-latest
    if: github.event.repository.fork != true || vars.ENABLE_CI_IN_FORK == 'true'
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"

      - name: Install dependencies
        run: npm ci

      - name: Prettier format check
        run: npm run format:check

  eslint:
    runs-on: ubuntu-latest
    if: github.event.repository.fork != true || vars.ENABLE_CI_IN_FORK == 'true'
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"

      - name: Install dependencies
        run: npm ci

      - name: ESLint
        run: npm run lint
