The GitHub Actions Lint-Only Workflow Builder generates a ready-to-commit CI workflow that runs the three fast static checks every pull request should pass: ESLint, a Prettier format check, and a TypeScript type-check. Because these finish in seconds, a dedicated lint workflow gives contributors near-instant feedback without waiting on a full test suite.
Why a separate lint workflow?
The instinct is to put lint, test, and build in a single job. Separating lint into its own workflow (or job) has two practical advantages:
- Speed — lint + type-check typically completes in 30–90 seconds on a cached runner, far faster than tests. Contributors see red or green immediately, without waiting for a slow test suite.
- Signal clarity — when lint fails, the PR check list shows exactly which check failed. A combined job that fails only shows “build” failed; you then have to read logs to find it was a formatting issue.
How it works
You select your package manager (npm, pnpm, or yarn), the Node version to run on, and which of the three checks to include. The builder writes a workflow triggered on pull_request (and optionally push) that:
- Checks out the code
- Sets up Node with
actions/setup-node@v4using built-in dependency caching keyed on your lockfile - Installs dependencies (
npm ci,yarn install --frozen-lockfile, orpnpm install --frozen-lockfile) - Runs each enabled check as its own named step
Splitting checks into separate steps means the Actions log shows exactly which one failed, rather than stopping at the first error.
What each check does
ESLint — static code analysis that catches real bugs (unused variables, missing await, incorrect prop types) as well as style issues. Configured by .eslintrc or eslint.config.js in your repo.
Prettier format check (prettier --check .) — verifies that every file matches the Prettier format exactly. Run prettier --write . locally to fix violations before pushing. No configuration means no debate about formatting in code review.
TypeScript type-check (tsc --noEmit) — runs the TypeScript compiler to check types without emitting output files. Catches type errors that editors may not surface, especially across file boundaries after refactoring.
The generated workflow looks like this
name: Lint
on:
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: ESLint
run: npm run lint
- name: Prettier
run: npx prettier --check .
- name: TypeScript
run: npx tsc --noEmit
Practical tips
- Cache is the biggest time saving. The
setup-nodecache stores your dependency downloads; on a repeated run with an unchanged lockfile it reduces a 60-second install to under 5 seconds. - Match commands to your package.json. The builder uses
npm run lintby default. If your lint script is named differently, update the step. - Enable required status checks. In your repo’s branch protection settings, add this workflow’s check as required so PRs cannot be merged while lint is failing.
- Run alongside tests, not instead of them. The fast lint check gives immediate feedback; keep your test job running too for full coverage.