You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: type-aware lint, and the four things it found (#34)
Four rules, on src only: no-floating-promises, no-misused-promises,
await-thenable, require-await. The broad recommendedTypeChecked preset is
deliberately not used -- most of it duplicates what strict already
enforces, at the cost of a much slower lint and a backlog of style
findings.
Five errors, of which one is a bug and two are traps:
- express/captcha.ts was an async RequestHandler. Express 4 does not catch
a rejected promise from a handler, so anything thrown inside
endpoints.handle() -- crypto, JSON, a store -- left the request hanging
until the client timed out, and logged an unhandled rejection instead of
returning 500. Now synchronous, with the rejection routed to next().
- invisible.ts attached an ASYNC submit listener. e.preventDefault() only
works because nothing had awaited yet; once the handler yields the
browser has already submitted and cancelling is a no-op. It worked, but
it was one added `await` away from silently breaking every protected
form, with no test that would notice. The async half is now its own
method, kicked off after the cancel.
- environment.ts let audioCtx.close() float. The surrounding try/catch does
not cover it, so a rejection surfaced as an unhandled rejection in the
user's console.
- violation-reporter's flush timer and the fastify plugin signature are
both fine as they were; they now say so rather than reading as
oversights.
ClosesWebDecoy/app#738
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,10 @@ One flat config at the repo root (`eslint.config.mjs`) covers every package —
82
82
83
83
`@typescript-eslint/no-explicit-any` is a **warning** under a per-package budget, set in each package's lint script (`eslint src --max-warnings N`). CI fails if the count grows, so a new `any` needs either a real type or a deliberate decision to raise the number. Lower it when you remove one.
84
84
85
+
Four **type-aware** rules run on `src` (not on tests): `no-floating-promises`, `no-misused-promises`, `await-thenable`, `require-await`. They need a TypeScript program and are slower, so the set is deliberately small — these catch things `tsc` does not, and the rest of `recommendedTypeChecked` mostly duplicates `strict` at the cost of a large style backlog.
86
+
87
+
`no-floating-promises` is the one that earns its keep here. This SDK does a lot of deliberate fire-and-forget — violation reporting, honeytoken derivation, directory warmup — and an accidental one looks identical to an intentional one. Mark the deliberate ones with `void`, and say in a comment why the rejection is safe to drop.
0 commit comments