name: Lint

on: pull_request

jobs:
  lint-check:
    name: Check for ESLint + Prettier Violations
    runs-on: ubuntu-latest

    steps:
      - name: Check out Git repository
        uses: actions/checkout@v2

      - name: node_modules cache
        uses: actions/cache@v4
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

      - name: Use Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 22.x

      - name: Install dependencies
        run: |
          yarn install --frozen-lockfile --network-timeout 300000

      - name: Prettier check
        run: |
          yarn run lint:prettier

      - name: Eslint check
        run: |
          yarn run lint:eslint
