Introduces a baseline ESLint configuration and wires it into CI. Config: - `eslint.config.mjs` (flat config, ESLint 9). Extends `eslint-config-next/core-web-vitals` and `eslint-config-next/typescript` directly — both ship as native flat-config arrays in `eslint-config-next` 16+. - Ignores cover `.next`, `out`, `src/generated`, `public/cesium`, `packages/*/dist`, plus the gitignored sandboxes (`local-scripts`, `local-plugins`, `local-seeders`, `.agents`, `.claude`, `.worktrees`). Rule policy: - All rules that the Next.js preset surfaces as errors are demoted to `warn` on first introduction, so the lint job is runnable against the current codebase without blocking on pre-existing debt. The demoted set (react-hooks/* in React 19's stricter purity suite, no-unescaped-entities, ban-ts-comment, no-assign-module-variable, prefer-const) plus the originally-flagged `no-explicit-any` and `no-console` are all documented in the config with a recommended promotion order. - Current state: 0 errors, 564 warnings. Scripts: - `pnpm lint` runs `eslint .`. CI: - New `lint` job in `.github/workflows/ci.yml`, parallel to typecheck / test / audit. Blocking on errors only — warnings are visible in the job log but don't fail the build. Same incremental-introduction pattern as the audit job (#97): land the infrastructure now, tighten policy via follow-up PRs as the backlog is worked down. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Co-authored-by: Silvertakana <[email protected]>
67 lines
1.5 KiB
YAML
67 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
typecheck:
|
|
name: Type Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: npx prisma generate
|
|
- run: pnpm exec tsc --noEmit
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm lint
|
|
|
|
test:
|
|
name: Unit Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: npx prisma generate
|
|
- run: pnpm test
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
needs: [typecheck, test]
|
|
env:
|
|
DATABASE_URL: postgresql://ci:ci@localhost:5432/ci
|
|
AUTH_SECRET: ci-placeholder-secret-not-used-in-tests
|
|
NEXT_PUBLIC_WWV_EDITION: local
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: npx prisma generate
|
|
- run: pnpm build
|