Repository navigation
Lint: dropped background tasks, async mistakes, and unhandled promises in the viewer - #3
Merged
Merged
Conversation
…s in the viewer ruff now also selects PLE (errors that crash at run time), ASYNC (blocking calls and other mistakes in async code) and RUF006 (an asyncio task whose result is dropped, so it can be garbage-collected mid-run). Four ASYNC rules that give advice rather than find bugs are left out (ASYNC109, ASYNC110, ASYNC115, ASYNC116). The viewer's oxlint runs four type-aware rules as errors: no-floating-promises, no-misused-promises, await-thenable and switch-exhaustiveness-check (a default case counts as handling the rest). oxlint-tsgolint, which runs them, is pinned in web/. None of the new rules finds anything on main today.
ryangswe
force-pushed
the
chore/type-aware-lint
branch
from
November 6, 2026 04:44
50132c1 to
3f1e51f
Compare
ryangswe
marked this pull request as ready for review
November 6, 2026 04:45
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.
Adds lint rules that find bugs, not style. None of them finds anything on
maintoday; they are there to stop the next one.Python (ruff,
pyproject.toml).selectgains three groups:PLE, code that fails at run time;ASYNC, blocking calls and other mistakes in async code;RUF006, anasynciotask whose result is dropped, so it can be garbage-collected mid-run.Four
ASYNCrules that give advice rather than find bugs are left out (ASYNC109, ASYNC110, ASYNC115, ASYNC116). For example, ASYNC109 flags anytimeoutparameter on an async function.Viewer (oxlint,
web/.oxlintrc.json). Four type-aware rules run as errors. They flag a promise nobody waits for or catches, an async function passed where a plain callback is expected, anawaiton something that is not a promise, and aswitchthat misses a case of a union. Type-aware rules needoxlint-tsgolint, which is pinned at 7.0.2006 inweb/.--type-awareis added to the lint script, the CI step and CLAUDE.md. oxlint is used because typescript-eslint supports TypeScript only up to 6.0, and the viewer is on 7.0.The two existing react warnings in
src/App.tsxare unchanged and don't fail the job.How it was checked
uvx ruff@0.17.4 check src testspasses, as does ruff 0.17.3, the version inuv.lock.uv lock --checkpasses, and so does.claude/workflow/check.py.npx oxlint --type-aware srcexits 0,tsc -bpasses, and the viewer builds.src/App.tsxand a missedModecase in a switch. On the Python side, a droppedasyncio.create_task(RUF006), a blocking call in async code (ASYNC251) and an undefined name.week1-two-rooms-protocolbranch doesn't touch these files.