Skip to content

chore(lint): lint findings fail ci instead of printing warnings - #258

Merged
AadiJo merged 2 commits into
mainfrom
lint-findings-fail-ci
Nov 15, 2026
Merged

AadiJo merged 2 commits into
mainfrom
lint-findings-fail-ci

Conversation

@AadiJo

@AadiJo AadiJo commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

A lint finding only printed a warning. vp check passed in CI with 74 of them on main, so new ones went in unnoticed.

Every enabled rule is now an error, main has zero findings, and the pre-commit hook lints staged files.

What changed

  • lint.categories (correctness, suspicious, perf) and cadsense/no-inline-schema-compile go from "warn" to "error".
  • options.denyWarnings: true, so a rule added at "warn" later still fails the run.
  • options.reportUnusedDisableDirectives: "error". CI never passed the CLI flag, so stale disable comments only showed up in pnpm lint. The root lint script drops the flag, because the flag overrides the config value and downgrades it to a warning.
  • staged runs vp fmt, then vp lint, on the staged files.

CI needs no workflow change. The Check job already runs vp check.

Findings per rule

Counted with vp lint --report-unused-disable-directives --format json on main (8412f96) and vp lint --format json on this branch, 1848 files each.

Rule main branch Decision
eslint/no-unused-vars 49 0 47 fixed, 2 disabled in place (see below)
cadsense/no-inline-schema-compile 10 0 fixed, compiled functions hoisted to module scope
react/no-array-index-key 9 0 rule off
unicorn/no-useless-spread 3 0 rule off
typescript/no-this-alias 1 0 fixed
eslint/no-unmodified-loop-condition 1 0 fixed
eslint/no-unsafe-optional-chaining 1 0 fixed
unused disable directive 1 0 removed
Total 75 0

The fixes remove unused imports, variables and one dead function, hoist schema compilers, and restructure three statements without changing what they do.

Rules turned off:

  • react/no-array-index-key. All 9 sites are positional lists with no stable id: drawing lines, table cells, location chips addressed by index. A tenth site in Checklist.tsx already had a disable comment for the same reason. That comment is removed.
  • unicorn/no-useless-spread. 2 of the 3 sites are [...x] snapshots taken before a loop mutates x. CadSceneRenderer.ts removes children while iterating, and ClaudeAdapter.ts cancels pending inputs that delete themselves from the map. Following the rule there introduces a bug.

Found, not fixed

  • apps/web/src/modelSelection.ts:159 and :208. getAppModelOptions and getAppModelOptionsForInstance accept selectedModel and never read it. resolveAppModelSelectionForInstance passes it only when preserveUnavailableSelection is set, so that option has no effect on the options list. Each parameter carries one oxlint-disable-next-line no-unused-vars with the reason. A fix changes which models the picker lists, so it belongs in a separate PR.

Verification

  • A scratch commit that added const deliberateLintFinding = 1; to packages/shared/src/model.ts made vp check exit 1 with Found 1 error and 0 warnings in 1848 files. The commit was dropped.
  • vp check also exits 1 for a rule set to "warn" and for an unused disable comment. The staged hook rejects a commit that contains a finding and leaves the staged change in place.
  • vp check and vpr typecheck pass on the branch.
  • Commit time through the hook, three runs each, on a machine with a load average near 20:
Staged files fmt only (main) fmt + lint (branch)
3 0.89 to 1.30 s 1.31 to 1.72 s
10 1.05 to 1.62 s 1.50 to 1.68 s
30 0.82 to 0.95 s 1.60 to 2.20 s

Open PRs that carry a finding will fail Check after this merges.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cadsense Ready Ready Preview Nov 15, 2026 5:46am UTC

@AadiJo
AadiJo merged commit 2b6263e into main Nov 15, 2026
12 checks passed
@AadiJo
AadiJo deleted the lint-findings-fail-ci branch November 15, 2026 05:49

This branch was successfully deployed

1 active deployment
Preview — c98e7de2 Deployed Nov 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant