A promise where a value is read: refused by the std types, promise-as-value, floating-promise #121

Merged
sionzee merged 54 commits from promise-statics into main 2026-11-21 23:31:06 +01:00
Owner

Based on flow-consumed (#120), and contains #119 and #120: the diff shown is this piece alone. The open pieces above #118 form one chain, each branch containing the ones below it: #119, #120, #121, #123, then #116 and #122. Merge them in that order.

Combined with the pieces below. The API map now carries this piece's callbacks section next to #120's consumes. A dropped call whose promise holds a Result gets one finding, must-use-result, not two.

Result<T, E> is T | Err<E>, a plain union, so a Promise<Result<T, E>> is itself a valid Result: its T is the promise. Everything that inspects a Result therefore accepted a promise somebody forgot to await, and answered "no error". These passed tsc strict, safe-ts check --deny-warnings and oxlint:

const n = q(load());                    // n is the promise; the error never returns
return isErr(load());                   // always false
quiet();                                // never rejects, so nothing said the caller goes on before it finished
ids.filter(async (id) => allowed(id));  // a promise is always truthy: nothing is filtered out
expect(check()).toBeTruthy();           // a test that always passes

What changes

The std types refuse a promise. isErr, isSome, isPanic, q, unwrapOr, mapErr, describeError, isJsonErr and expectPresent no longer compile when handed one. tsc says: Property '"this is a promise: await it, then pass the value"' is missing in type 'Promise<...>'. A generic Result<T, E> still compiles, and a Result<Promise<T>, E> written on purpose with its E named is let through.

New rule promise-as-value (error), for the places tsc stays silent, with a quick fix that adds await:

Form tsc The rule
if (p), p + 1, p.length, switch (p) rejects leaves it
isErr(p), q(p) and the other std readers now rejects reports, with the fix
`${p}`, !p, p ?? x, p === undefined, String(p), JSON.stringify(p) accepts reports
an async callback to filter / some / every / find*, forEach, new Promise(async ...), a reduce that doesn't await its accumulator accepts reports
items.map(async ...) read as values (.filter(Boolean), .some(...)), also through a const accepts reports
expect(p) without .resolves / .rejects; assert.ok(p) accepts reports
a project function whose parameter's answer it reads right away, handed an async function accepts reports

Which built-ins read their callback's answer at once is data in the ECMAScript map, with a test on the running engine. A method counts as the built-in's when the receiver's written type says so: Node's Readable.filter(async ...), which awaits its predicate, is not reported.

New rule floating-promise (warning). A promise dropped as a statement, when it cannot reject (floating-rejection covers the ones that can). await, return, a chain, or void says it is on purpose. It is reported wherever the statement is; the value of an expression-bodied arrow, a function passed by name, and a Vue template's inline handler are not statements and stay silent.

What turns red on upgrade

  • Explicit type arguments that are type parameters. isErr<T, E>(r) or unwrapOr<T, E>(r, fallback) inside a generic function stops compiling, with Argument of type 'Result<T, E>' is not assignable to parameter of type 'NotAPromise<CheckResult<T, E>, Result<T, E>>'. The fix is to drop the type arguments. The message does not mention promises, so it is spelled out in the changelog and on the rule's page.
  • A dropped async call without void becomes a warning.

On an adopter's project: no new findings from either rule, and nothing stops compiling under real tsc with the changed std. That project already writes void on its 44 deliberate fire-and-forget calls; all were read, and none is an ordering hazard.

Evidence

  • The type change across compilers. It works through a type parameter whose default fails its own constraint, so each signature carries one @ts-expect-error, in source that every consumer's tsc compiles. I type-checked a consumer project against it under TypeScript 5.5.4, 5.6.3, 5.7.3, 5.8.3, 5.9.3, 6.0.3, 7.0.2 and 7.1.0-beta: all clean, the promise calls refused in every one. npm run test:std now compiles a consumer under both TypeScript 7 and 5.9, so a compiler that stops raising the error fails the test instead of every adopter's build.
  • Held-out cases. Arrow and by-name forms agree (ids.filter(allowed), q(loader()) with const loader = load); optional calls (hooks?.flush()), calls through a typed field, and a constructor that starts work are reported; a promise kept for Promise.all, pushed to a list, compared by identity or returned is silent.
  • Soundness corpus: five classes added, all escaping at the starting commit and rejected now.
  • Whole-program pass on that project's largest entry: 916 ms before, 956 ms after.

What stays unseen

  • A promise kept in a let or a field.
  • A method named like a built-in's on a receiver with no written type: it is taken for the built-in.
  • floating-promise for package and platform calls.
  • console.log(p) and other calls that merely print or pass the promise on.

Created with Claude Opus 5.5 (implementation) and Claude Fable 5.2 (review, acceptance tests and one fix) in Claude Code.

Based on `flow-consumed` (#120), and contains #119 and #120: the diff shown is this piece alone. The open pieces above #118 form one chain, each branch containing the ones below it: #119, #120, #121, #123, then #116 and #122. Merge them in that order. **Combined with the pieces below.** The API map now carries this piece's `callbacks` section next to #120's `consumes`. A dropped call whose promise holds a `Result` gets one finding, `must-use-result`, not two. `Result<T, E>` is `T | Err<E>`, a plain union, so a `Promise<Result<T, E>>` is itself a valid `Result`: its `T` is the promise. Everything that inspects a `Result` therefore accepted a promise somebody forgot to `await`, and answered "no error". These passed `tsc` strict, `safe-ts check --deny-warnings` and oxlint: ```ts const n = q(load()); // n is the promise; the error never returns return isErr(load()); // always false quiet(); // never rejects, so nothing said the caller goes on before it finished ids.filter(async (id) => allowed(id)); // a promise is always truthy: nothing is filtered out expect(check()).toBeTruthy(); // a test that always passes ``` ## What changes **The std types refuse a promise.** `isErr`, `isSome`, `isPanic`, `q`, `unwrapOr`, `mapErr`, `describeError`, `isJsonErr` and `expectPresent` no longer compile when handed one. `tsc` says: *Property '"this is a promise: `await` it, then pass the value"' is missing in type 'Promise<...>'*. A generic `Result<T, E>` still compiles, and a `Result<Promise<T>, E>` written on purpose with its `E` named is let through. **New rule `promise-as-value`** (error), for the places `tsc` stays silent, with a quick fix that adds `await`: | Form | `tsc` | The rule | |---|---|---| | `if (p)`, `p + 1`, `p.length`, `switch (p)` | rejects | leaves it | | `isErr(p)`, `q(p)` and the other std readers | now rejects | reports, with the fix | | `` `${p}` ``, `!p`, `p ?? x`, `p === undefined`, `String(p)`, `JSON.stringify(p)` | accepts | reports | | an async callback to `filter` / `some` / `every` / `find*`, `forEach`, `new Promise(async ...)`, a `reduce` that doesn't await its accumulator | accepts | reports | | `items.map(async ...)` read as values (`.filter(Boolean)`, `.some(...)`), also through a `const` | accepts | reports | | `expect(p)` without `.resolves` / `.rejects`; `assert.ok(p)` | accepts | reports | | a project function whose parameter's answer it reads right away, handed an async function | accepts | reports | Which built-ins read their callback's answer at once is data in the ECMAScript map, with a test on the running engine. A method counts as the built-in's when the receiver's written type says so: Node's `Readable.filter(async ...)`, which awaits its predicate, is not reported. **New rule `floating-promise`** (warning). A promise dropped as a statement, when it cannot reject (`floating-rejection` covers the ones that can). `await`, `return`, a chain, or `void` says it is on purpose. It is reported wherever the statement is; the value of an expression-bodied arrow, a function passed by name, and a Vue template's inline handler are not statements and stay silent. ## What turns red on upgrade - **Explicit type arguments that are type parameters.** `isErr<T, E>(r)` or `unwrapOr<T, E>(r, fallback)` inside a generic function stops compiling, with *Argument of type 'Result<T, E>' is not assignable to parameter of type 'NotAPromise<CheckResult<T, E>, Result<T, E>>'*. The fix is to drop the type arguments. The message does not mention promises, so it is spelled out in the changelog and on the rule's page. - **A dropped async call without `void`** becomes a warning. On an adopter's project: no new findings from either rule, and nothing stops compiling under real `tsc` with the changed std. That project already writes `void` on its 44 deliberate fire-and-forget calls; all were read, and none is an ordering hazard. ## Evidence - **The type change across compilers.** It works through a type parameter whose default fails its own constraint, so each signature carries one `@ts-expect-error`, in source that every consumer's `tsc` compiles. I type-checked a consumer project against it under TypeScript 5.5.4, 5.6.3, 5.7.3, 5.8.3, 5.9.3, 6.0.3, 7.0.2 and 7.1.0-beta: all clean, the promise calls refused in every one. `npm run test:std` now compiles a consumer under both TypeScript 7 and 5.9, so a compiler that stops raising the error fails the test instead of every adopter's build. - **Held-out cases.** Arrow and by-name forms agree (`ids.filter(allowed)`, `q(loader())` with `const loader = load`); optional calls (`hooks?.flush()`), calls through a typed field, and a constructor that starts work are reported; a promise kept for `Promise.all`, pushed to a list, compared by identity or returned is silent. - **Soundness corpus:** five classes added, all escaping at the starting commit and rejected now. - **Whole-program pass** on that project's largest entry: 916 ms before, 956 ms after. ## What stays unseen - A promise kept in a `let` or a field. - A method named like a built-in's on a receiver with no written type: it is taken for the built-in. - `floating-promise` for package and platform calls. - `console.log(p)` and other calls that merely print or pass the promise on. Created with Claude Opus 5.5 (implementation) and Claude Fable 5.2 (review, acceptance tests and one fix) in Claude Code.
Open: `Result<T, E>` is `T | Err<E>`, so a `Promise<Result<T, E>>` is a `Result` too. `q`,
`isErr`, `isSome`, `unwrapOr`, ... accepted a promise nobody awaited and answered "no error";
TypeScript and the checker let a promise through as text, under `!`, `||`, `??`, in a
comparison with `undefined`; an async predicate handed to `filter` (or to a project function
declared `(x: T) => unknown`) kept every item; and an async call that can't reject, dropped as
a statement, let the caller go on with nothing reporting it.

Closed:
- std: the functions that read a value refuse a promise in their types (`PromiseCheck`,
  `AwaitFirst`: "this is a promise: `await` it, then pass the value"), via a last type
  parameter whose undecidable default falls back to its constraint, so generic code and a
  `Result<Promise<T>, E>` written on purpose still compile. Checked under TypeScript 7 and 5.9,
  and over an adopter copy: nothing new stops compiling.
- `promise-as-value` (error): those calls, the places TypeScript lets a promise through, an
  async callback handed to a built-in that reads its answer right away (the map's new
  `callbacks`, tested on Node; the ones lib types are left to tsc), and to a project function
  whose parameter type lets one through and whose body reads it. Quick fix: Add await.
- `floating-promise` (warning): a dropped promise that can't reject; never the same call as
  `floating-rejection`; not the last statement of an event handler or timer.
- Soundness corpus: five classes (promise-read-as-result, promise-read-as-text,
  floating-promise-ordering, async-callback-read-right-away,
  async-callback-read-by-project-function), all escaping at e8029782, all rejected now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open after f10ffd50:
- `promise-as-value` took any `filter` or `forEach` for the built-in's, also on a receiver whose
  type says otherwise (Node's `Readable`, whose `filter` awaits; a class of the project).
- `floating-promise` exempted the last statement of a timer or listener but not of a hook, so
  the verdict depended on which callers the checker knew.
- Missed: an optional call dropped (`hooks?.flush()`), a call through a declared function type
  (`flush: () => Promise<void>`), `const flags = ids.map(async ...)` read through the `const`,
  an assertion on a promise (`expect(p).toBeTruthy()`, `assert.ok(p)`); a receiver declared
  `Option<C>` wasn't followed to `C`'s methods by any rule.
- std's ten `@ts-expect-error` (TS2344) directives were held by one compiler only.

Closed:
- A method is the built-in's by the receiver's written type (array, typed array, Map, Set,
  iterator, DOM list; through an alias, a declared return type, a chain, across files); another
  written type isn't; an unwritten one is taken for the built-in (policy on the rule page).
- `floating-promise` reports a statement wherever it is; an arrow's value, a function passed by
  name and a Vue template's handler aren't statements.
- The misses above; `Option` / `Readonly` / `Mut` / `NonNullable` receivers are followed
  (entry_points: `port: Mut<Port>` now gets `Port`'s verdict, failure-contract).
- `typescript-versions.test.ts` compiles std, a consumer project and awaited.check.ts with
  TypeScript 7 and 5.9 (the one vue-tsc-tools installs); explicit type arguments that are type
  parameters are documented with the message users see and the fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mapped promises read as values: a plain arrow that returns one counts like an async one
All checks were successful
Benchmarks / bench (pull_request) Successful in 3m38s
Tests / test (pull_request) Successful in 12m49s
4eed7ea98b
`ids.map(async (id) => allowed(id))` read through `.some(Boolean)` was reported;
`ids.map((id) => allowed(id))` was not, although the list holds the same promises.
The callback forms the other checks already know (async, by name, an arrow whose body
is a call) now all apply here.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Open: each rule that asks "did A happen before B on some path" had its own walker with
its own idea of branches, loops and exits (number-parse-nan and not-found-index took source
order, stale-read an ancestor walk, holders and bounds their own exits).

Closes the first step: flow.rs builds a graph per function body on request (if, ?:, &&/||/??
as jumping code, optional chains, loops with back edges, switch fall-through, labelled
break/continue, return/throw, try/catch/finally with a finally copy per way out; nested
functions are one point; await/yield end their block) and a bitset forward data-flow driver
(Meet::Any / Meet::Every, replay). number-parse-nan decides "used before a check" on it:
identical on the adopter; three fixture cases the source-order walk got wrong (a check in the
other branch, a use on the next loop round, a new value assigned).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
What was open: each of these passed tsc strict, `safe-ts check --idiomatic --deny-warnings`
and oxlint with the preset, and none was counted or ratcheted.

- `// @safe-ts std` / `// @safe-ts legacy`: one comment turned every rule off for a file (and
  `std` made its functions count as never failing for callers), and nothing said who may write
  it. Now a marker counts only in files the nearest "safe-ts" package.json lists under
  "trustedFiles" / "legacyFiles" (patterns as in "overrides", relative to it). Anywhere else it
  is an `unlisted-marker` error at the marker and the file is checked, transformed and followed
  as if it weren't there: check, the editor, the oxlint plugin, the Vite plugin and the loader
  all go through `Project::markers_allowed` (part of the analysis cache key). Library code in
  node_modules keeps its markers. `safe-ts check` prints, per package.json, the lines that list
  every marked file it found. The repository's packages, the demo, the fixtures and the docs
  examples list theirs.
- `eslint-disable*` / `oxlint-disable*` comments were counted nowhere, and silenced the oxlint
  plugin. Now all are counted; a blanket one or one naming a `safe-ts/` rule is reported by the
  new `no-lint-suppression`, on the directive's name inside the comment, where oxlint's own
  directive ranges don't reach (measured: a block directive applies from its comment's end, a
  `-line` one to the code before the comment). A named rule of another linter is only counted.
- `declare const | let | var | function | class | enum | namespace`, `declare global`,
  `declare module "..."` and the project's own .d.ts files were casts with no `as`. Now they
  are counted, the CLI checks the .d.ts files under the entries' directories (as the editor and
  oxlint already did), and the new `no-unchecked-declare` reports what asserts a value nothing
  checks (a type other than `unknown` or one admitting `undefined`, functions, classes, enums,
  required members added to a built-in or in a package augmentation, values added to a project
  module, `declare module "x";` with no body).
- `defineSanitizer(...)` was not counted; now it is, also through `export *` and renamed
  re-exports in project modules (and so are re-exported `trust()` and `panic()`).

The three counts are in the summary line, `--json --summary` and the baseline, and a test holds
the three together. An old baseline without the new keys loads; a missing count is 0, so the
gate fails once with a note until it is written again.

Soundness corpus: four new classes (unlisted std marker, unlisted legacy marker, a declared
value, a member declared on Array) that escaped before and are rejected now; the corpus project
lists no marker files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open: a value used again after an operation used it up passed every gate (a generator or an
array's iterator iterated twice, an ArrayBuffer used after transfer() or a transfer list, a
Response body read twice, a locked stream, a closed WebSocket, MessagePort, FileHandle or
readline interface), and must-use-result only saw a Result dropped as a statement, not one kept
in a local and only logged.

Closes:
- use-after-consume (an error, on by default), on the flow layer: a fact per operation site,
  set where it runs, cleared by a new value or releaseLock(); a second solve on every path
  words "on one path". Which operations consume, what state they leave and which uses fail is
  data: a `consumes` section in ecmascript-api.json, browser-api.json and node-api.json
  (compiled in; a platform's findings kept where its pack is on), demonstrated on Node
  (ecmascript/consumes.test.ts, packages/feature-*/test/consumes.test.ts) and, for Worker and
  the global postMessage, in Chromium, Firefox and WebKit (test:browsers). The packs' safe
  versions count as the member they stand for. A view made on a buffer before the transfer
  reads the detached buffer (reported); one made after throws where it is made.
- must-use-result: a call kept in a local (kept.rs) that, on some path to an end after the
  last code that looks at it, nothing looks at, or that a new value replaces first; the
  whole-program pass reports the ones whose function returns a Result. Logging and string
  conversion aren't looking; handing it on, storing it, capturing it, returning it are. An
  exception and an early return before the look aren't drops; a short-circuit test of several
  counts for each.
- Soundness corpus: one-shot-generator-reused and use-after-consume-arraybuffer come off
  escaping.txt; new classes response-body-read-twice and result-kept-only-logged (both escape
  at the starting commit, both rejected now).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open: the new rule, the kept-Result part of must-use-result, the consumes format and the paths
number-parse-nan now follows were undocumented, and two pages said number-parse-nan takes source
order.

Closes: docs/rules/use-after-consume.md (idiomatic forms first, what it can't see),
must-use-result's "A Result kept in a local", docs/guide/flow.md, the `consumes` format in the
libraries guide (and a pointer from the built-ins guide), number-parse-nan's and
not-found-index's pages, README (rules table, known gaps), docs index and sidebar, the errors
guide, CHANGELOG (Added: the rule and the flow layer; Changed: must-use-result and
number-parse-nan, with what to write instead), and the migration skill's patterns and tool gaps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open: npm run typecheck failed on packages/pack-kit/consumes.ts (a DOM-only type name, and a
check TypeScript took for always true). Closes: a structural type for the read result, and the
demonstration typed as possibly missing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
What was open after 25d3ef37, and what closes it:

- A hatch was counted only when called by its imported name: `r.trust(x)`, `const t = trust;
  t(x)`, `(0, trust)(x)`, `trust.call(...)`, `r.unsafe(...)`, `stop = panic` counted nothing, so
  `export const forged = r.trust<T>("no")` passed the baseline uncounted. Now one pass over the
  semantic references of every binding that may hold one (named and namespace imports,
  destructuring, dynamic `import()`, prelude names; hatch_refs.rs) classifies each use: a call,
  `.call` / `.apply` / `.bind`, a copy followed to its own uses (an exported copy counts once),
  and any other use counted (handed on, re-exported, a std namespace used whole: fail closed).
  Types (`typeof trust`) don't count. The whole program decides which imports are hatches,
  through re-exports, and counts `export { x as y } from` of one.
- With std or the Vue package linked into a workspace, `defineSanitizer` counted 0: the
  resolver calls those files the project's. Now the package.json that owns the defining file
  says what it is, and a SAFE-TS package's own files aren't counted as uses.
- vue-tsc's `<!-- @vue-ignore -->`, `<!-- @vue-skip -->` and `<!-- @vue-expect-error -->` were
  neither reported nor counted. Now `no-ts-suppression` reports ignore, skip and a reasonless
  expect-error; ignore counts with @ts-ignore, expect-error with @ts-expect-error, skip as the
  new `vueSkips`.
- A disable of an oxlint rule the preset makes an error (`no-eval`, `no-proto`, ...) passed
  silently: those rules are how SAFE-TS bans the constructs. Now one without `-- reason` is
  reported by `no-lint-suppression`. The same at config level: `.oxlintrc.json` next to the
  package.json (JSON with comments) is read, and a config not extending the preset, a preset
  rule turned off or down in "rules" or "overrides", and "ignorePatterns" are named as weakened
  settings, which the baseline ratchets.
- `declare value: string` in a class was silent while `value!: string` is a cast. Now it is
  reported by `no-unchecked-declare` and counted with the ambient declarations.
- Docs that teach a `declare` form are checked with the rule on (`declares` fence word), and
  say what the rule asks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open (review): a buffer transferred through its view (`[pixels.buffer]`, `pixels.buffer.transfer()`)
left the views unreported; `maybe?.transfer()` wasn't seen; `const same = buf` was a stranger;
and the browser and Node `consumes` were compiled into the checker, so a third-party pack (or a
project's own) couldn't declare one, and a pack's version could disagree with the checker's.

Closes:
- A pack's `consumes` is read from its safe-ts.json with the rest of the pack (Manifest::consumes;
  the browser and Node packs copy theirs from their API maps when safe-ts.json is generated, and
  the manifest tests keep the two equal). Only the language's map stays compiled in. A pack's
  safe versions come from its manifest's `safe` refs. What a pack gets wrong (an entry described
  differently from an earlier pack, an operation on a state nobody describes, a section that
  isn't one) is a setup warning and that entry is left out (consumed::for_packs, unit tests).
  Fixture consume_pack: a tiny third-party pack with a one-shot cursor.
- Groups (Cx::group): a second name (`const same = buf`, neither reassigned) is the same value;
  a typed array or DataView is a view on a buffer (the one it was made on, `x.buffer`, or its
  own); `x.buffer` in a transfer list or `x.buffer.transfer()` uses up every view of the group.
  `x.buffer.detached` is asking, not using. A reassigned `let`, a property or a destructuring
  isn't followed.
- The flow layer keyed points by span alone, so a call inside an optional chain shared its key
  with the chain (`a?.b()`), and an expression statement without `;` with its expression: points
  are keyed by span and kind now (flow::PointKey). That is what hid `maybe?.transfer()`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Weakened lint settings are named by .oxlintrc.json, the file that sets them
All checks were successful
Benchmarks / bench (pull_request) Successful in 3m54s
Tests / test (pull_request) Successful in 7m48s
6577df1a9a
The check listed `oxlint.rules no-eval off (package.json)`: the setting lives in the
`.oxlintrc.json` beside it, and that is where a reader has to look.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Kept Results beyond a bare call; the cheap test before any graph; the layer's path table
All checks were successful
Benchmarks / bench (pull_request) Successful in 3m57s
Tests / test (pull_request) Successful in 8m6s
9a540ef57e
Open (review): `const r = flag ? save(1) : save(2)` and `const [a, b] = await Promise.all([...])`
weren't seen as kept Results; the kept-Result analysis built a graph for one function in five on
the adopter's largest entry (2,561 of ~10,500) and use-after-consume for 539, mostly for calls
that can't matter; and the layer was held only by ten unit tests and the rules' fixtures.

Closes:
- Kept: each call of a `?:` / `??` / `||` / `&&` / parenthesised / awaited initialiser, and each
  element of an array destructuring of `Promise.all` / `allSettled` over a list written in
  place, in the binding at its place (fixtures). `const { result } = pair()` isn't (only
  `pair`'s return type says what `result` is).
- The cheap test first. Kept Results: the local pass only lists the kept calls (no graph),
  after two syntactic tests (a const looked at unconditionally by the very next statement; a
  call whose callee the file shows returns a plain type, or a method of a value declared with
  one); the whole-program pass keeps those whose function returns a Result and only then
  parses the file again and builds graphs for them (`unsafe(...)` / `parseJson` stay local).
  use-after-consume: a function gets a graph only if an operation there would use a binding
  up (`Array.from(list)` of an array doesn't); the generator walk runs only in a file with a
  `function*`. On the adopter's `apps/client/src/start.ts`: 3,119 graphs before (2,561 kept,
  539 consumed, 19 number-parse-nan), 40 after (21, 0, 19).
- flow::tests::path_cases: 39 shapes with their answers on some / every path, independent of
  any rule (labelled break and continue, do...while, a loop's update clause, for await,
  continue in try/finally, finally after a return, nested finally, switch with default in the
  middle and falling into it, && / || in a statement and a test, ?:, ??, ||=, optional calls,
  yield and await between, reset, an exception into catch, nested functions, unreachable code).
- Docs: the libraries guide says a pack's `consumes` is read from its safe-ts.json (and the
  manifest example shows it); use-after-consume's page covers views, second names and optional
  calls; must-use-result's covers branches and Promise.all; README gaps, CHANGELOG, tool gaps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts, all kept from both sides: `analyze_file_with` / `analyze_vue_with` / `analyze`
take both the `consumes` table and the `MarkerPermission`; `Project::analyze_text` passes
both; `FeatureSet` has `consumes` and the marker lists / oxlint weakenings; the rule list,
the sidebar (no-lint-suppression, unlisted-marker and no-unchecked-declare under Ignore
comments, use-after-consume under Correctness), the module list and the CHANGELOG's Added
and Changed entries hold both pieces'. `kept_results` and the hatch-counting functions of
project.rs sit side by side.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts, all kept from both sides: ecmascript-api.json gets both new sections (`callbacks`
and `consumes`, merged as JSON: each side only added its own key); package.json takes
`test:std` from this side (vue-tsc tools for the TypeScript-versions test) and `test:browsers`
from the other (the browsers' consumes test); the soundness class list imports both new
groups; the migration skill has both sections ("A promise used as its value", "A value used
after it was used up") and census.mjs both pointers; the CHANGELOG's Added and Changed keep
every entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Open: with no-unchecked-declare (escape-hatches-2) in the chain, `declare function
openStream(): Readable;` in the receivers fixture is reported, as every other fixture stub's
`declare` is. Closes: the expectation written on it, as on the other fixtures' stubs; the
stub stays, since what the fixture shows is a call returning a package's Readable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ambient declarations test: a neutral member name in the sample
All checks were successful
Benchmarks / bench (pull_request) Successful in 4m9s
Tests / test (pull_request) Successful in 9m13s
6e1cc600bc
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Merge the chain below: a neutral member name in the ambient declarations test
All checks were successful
Benchmarks / bench (pull_request) Successful in 4m19s
Tests / test (pull_request) Successful in 9m56s
259c12be10
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
A dropped promise that holds a Result gets one finding, not two
All checks were successful
Benchmarks / bench (pull_request) Successful in 4m14s
Tests / test (pull_request) Successful in 9m10s
7c841c8442
`load();` with `load(): Promise<Result<...>>` was both `floating-promise` and
`must-use-result`. The dropped `Result` is the finding; awaiting it and looking at it
answers both, so `floating-promise` leaves the call to that rule, as it already does
for the rules about failures.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
sionzee changed target branch from sentinel-values to flow-consumed 2026-11-21 20:38:47 +01:00
sionzee changed target branch from flow-consumed to main 2026-11-21 23:29:42 +01:00
Merge main
All checks were successful
Benchmarks / bench (pull_request) Successful in 3m19s
Tests / test (pull_request) Successful in 9m14s
8e06ceefb1
Co-Authored-By: Claude Fable 5.2 <[email protected]>
sionzee deleted branch promise-statics 2026-11-21 23:31:06 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Evobug/Safe-Ts!121
No description provided.