name: JS Code Style

on:
  push:
    branches: [ master ]
    paths:
      - 'src/pretix/static/pretixpresale/widget/**'
      - 'src/pretix/static/pretixcontrol/js/ui/checkinrules/**'
      - 'src/pretix/plugins/webcheckin/**'
      - 'eslint.config.mjs'
      - 'package.json'
      - 'package-lock.json'
  pull_request:
    branches: [ master ]
    paths:
      - 'src/pretix/static/pretixpresale/widget/**'
      - 'src/pretix/static/pretixcontrol/js/ui/checkinrules/**'
      - 'src/pretix/plugins/webcheckin/**'
      - 'eslint.config.mjs'
      - 'package.json'
      - 'package-lock.json'

permissions:
  contents: read

env:
  FORCE_COLOR: 1

jobs:
  eslint:
    name: eslint
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
      - name: Set up Node.js 24
        uses: actions/setup-node@v4
        with:
          node-version: 24
          cache: npm
      - name: Install Dependencies
        run: npm ci
      - name: Run ESLint
        run: npm run lint:eslint
