From 211a5045c4b8a96bd65681922ef7599afbd7ee7b Mon Sep 17 00:00:00 2001 From: "John R. D'Orazio" Date: Mon, 17 Aug 2026 23:19:58 +0200 Subject: [PATCH] ci: run eslint on PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing in CI ran eslint. The `lint` check in the PR list comes from lint-markdown.yml and only covers markdown, so `npm run lint` was never exercised by any workflow. Found via the typescript 7 dependabot PR (#284), which shows every check green while `npm run lint` cannot start at all: typescript-eslint does not support TS 7.0. See also typescript-eslint#10940 for tracking support for TS >=7.1 That is not a subtle regression — eslint refuses to run — and CI could not tell it apart from a clean bump. Any dependency change that breaks linting for every developer would merge green. Blocking rather than continue-on-error, matching lint-markdown.yml: eslint exits 0 on main today (verified before adding the gate), so a failure here is a real regression, not pre-existing debt being surfaced. Path filters are deliberately broad — `eslint .` lints every JS/TS file not covered by globalIgnores in eslint.config.mjs, including scripts and wordpress theme assets, so narrowing to app/ and lib/ would reintroduce a smaller version of the same blind spot. Job is named `eslint` so it is distinguishable from lint-markdown.yml's `lint` in the checks list. Action SHAs match the newest already pinned in this repo (checkout v7.0.1, setup-node v6). Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/lint-eslint.yml | 74 +++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/lint-eslint.yml diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml new file mode 100644 index 0000000..b12833a --- /dev/null +++ b/.github/workflows/lint-eslint.yml @@ -0,0 +1,74 @@ +name: ESLint + +# Runs `npm run lint` (eslint .) over the Next.js source. +# +# This gap was found the hard way: the typescript@7 dependabot PR (#284) +# showed every check green while `npm run lint` could not start at all — +# typescript-eslint refuses TS 7.0 outright ("typescript-eslint does not +# support TS 7.0", tracked upstream in typescript-eslint#10940). Nothing in +# CI ran eslint, so a dependency bump that breaks linting for every developer +# was indistinguishable from one that doesn't. +# +# Blocking, matching lint-markdown.yml: eslint passes clean on main today, so +# a failure here means a real regression rather than pre-existing debt. +# +# Note the `lint` job name in the checks list belongs to lint-markdown.yml; +# this job is `eslint` so the two are distinguishable at a glance. +# +# All interpolations are repo-controlled identifiers used as concurrency- +# group keys, not shelled out. No untrusted github.event.* inputs. + +permissions: + contents: read + +on: + pull_request: + branches: [main] + paths: + - '**/*.ts' + - '**/*.tsx' + - '**/*.js' + - '**/*.jsx' + - '**/*.mjs' + - '**/*.cjs' + - 'eslint.config.mjs' + - 'package.json' + - 'package-lock.json' + - '.github/workflows/lint-eslint.yml' + push: + branches: [main] + paths: + - '**/*.ts' + - '**/*.tsx' + - '**/*.js' + - '**/*.jsx' + - '**/*.mjs' + - '**/*.cjs' + - 'eslint.config.mjs' + - 'package.json' + - 'package-lock.json' + - '.github/workflows/lint-eslint.yml' + +concurrency: + group: lint-eslint-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + eslint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Setup Node.js + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6 + with: + node-version-file: .nvmrc + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Run ESLint + run: npm run lint