name: Lint

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  prettier:
    name: Prettier Check
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Checkout code
        uses: actions/checkout@v6

      - name: Setup Node.js
        uses: actions/setup-node@v6
        with:
          node-version-file: .nvmrc

      - name: Install dependencies
        run: npm ci

      - name: Run Prettier check
        run: npm run prettier:check

  eslint:
    name: ESLint Check
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Checkout code
        uses: actions/checkout@v6

      - name: Setup Node.js
        uses: actions/setup-node@v6
        with:
          node-version-file: .nvmrc

      - name: Install dependencies
        run: npm ci

      - name: Run ESLint
        run: npm run lint
