Repository navigation
chore(lint): lint findings fail ci instead of printing warnings - #258
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A lint finding only printed a warning.
vp checkpassed 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) andcadsense/no-inline-schema-compilego 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 inpnpm lint. The rootlintscript drops the flag, because the flag overrides the config value and downgrades it to a warning.stagedrunsvp fmt, thenvp 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 jsonon main (8412f96) andvp lint --format jsonon this branch, 1848 files each.eslint/no-unused-varscadsense/no-inline-schema-compilereact/no-array-index-keyunicorn/no-useless-spreadtypescript/no-this-aliaseslint/no-unmodified-loop-conditioneslint/no-unsafe-optional-chainingThe 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 inChecklist.tsxalready 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 mutatesx.CadSceneRenderer.tsremoves children while iterating, andClaudeAdapter.tscancels pending inputs that delete themselves from the map. Following the rule there introduces a bug.Found, not fixed
apps/web/src/modelSelection.ts:159and:208.getAppModelOptionsandgetAppModelOptionsForInstanceacceptselectedModeland never read it.resolveAppModelSelectionForInstancepasses it only whenpreserveUnavailableSelectionis set, so that option has no effect on the options list. Each parameter carries oneoxlint-disable-next-line no-unused-varswith the reason. A fix changes which models the picker lists, so it belongs in a separate PR.Verification
const deliberateLintFinding = 1;topackages/shared/src/model.tsmadevp checkexit 1 withFound 1 error and 0 warnings in 1848 files. The commit was dropped.vp checkalso 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 checkandvpr typecheckpass on the branch.Open PRs that carry a finding will fail Check after this merges.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.