Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,17 +443,24 @@ To be released.
failures, and in Oxlint, where it has to be enabled by name. It is not
registered in Deno Lint, which reports every plugin rule as an error.
[[#1401], [#1443]]
- Changed `outbox-listener-delivery-not-awaited` to follow arrays of delivery
promises returned by synchronous local helpers. Awaiting or discarding
such an array now produces a warning; use `Promise.all()` to wait for its
deliveries. Mixed or unknown helper returns remain unreported.
[[#1070], [#1446]]
- Extended `raw-property-iri-invalid` to check `withRawProperty()` and
static record and tuple keys passed to `withRawProperties()`. The rule
reports invalid property IRIs and compact prefixes such as `as:content`
across Deno Lint, ESLint, and Oxlint. [[#1355], [#1420]]

[#1070]: https://github.com/fedify-dev/fedify/issues/1070
[#1272]: https://github.com/fedify-dev/fedify/issues/1272
[#1355]: https://github.com/fedify-dev/fedify/issues/1355
[#1356]: https://github.com/fedify-dev/fedify/pull/1356
[#1401]: https://github.com/fedify-dev/fedify/issues/1401
[#1420]: https://github.com/fedify-dev/fedify/pull/1420
[#1443]: https://github.com/fedify-dev/fedify/pull/1443
[#1446]: https://github.com/fedify-dev/fedify/pull/1446

### @fedify/mysql

Expand Down
10 changes: 10 additions & 0 deletions changes.d/lint/helper-delivery-arrays.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
links:
'#1070': https://github.com/fedify-dev/fedify/issues/1070
'#1446': https://github.com/fedify-dev/fedify/pull/1446
---
- Changed `outbox-listener-delivery-not-awaited` to follow arrays of delivery
promises returned by synchronous local helpers. Awaiting or discarding
such an array now produces a warning; use `Promise.all()` to wait for its
deliveries. Mixed or unknown helper returns remain unreported.
[[#1070], [#1446]]
23 changes: 16 additions & 7 deletions docs/manual/lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -1017,13 +1017,22 @@ When it cannot tell where a promise goes, the rule stays quiet. In practice:
reported. A callback that is invoked immediately, or given to `map()` or
`then()`, is only as safe as the result of that call. The same holds for a
function passed by name, as in `inboxes.forEach(deliver)`.
- A local helper that delivers is judged by how it is called: `deliver();` is
reported when `deliver()` awaits or returns a delivery, and
`await deliver();` is not. An array of promises, or an object holding one,
that a helper returns is not followed to where the helper is called, since
the caller may pass it to `Promise.all()`. So `await deliverAll();` and a
bare `deliverAll();` are not reported when `deliverAll()` returns the
result of `map()`.
- For a local helper that awaits or returns a delivery, the rule reports a
bare `deliver();` call but not `await deliver();`. A synchronous helper
that consistently returns an array of delivery promises is followed to its
call sites, including through other local helpers. `await deliverAll();`,
a bare `deliverAll();`, and returning that array from the listener are
reported; use `await Promise.all(deliverAll())` to wait for the deliveries.
An intermediate `await` preserves the array:
`await Promise.all(await deliverAll())` and storing `await deliverAll()`
for later aggregation are accepted. Arrays returned by synchronous
`flatMap()` callbacks are followed through the flattened result. A named
`forEach()` callback returning a delivery array is reported because
`forEach()` discards it; a helper passed as `thisArg` is not invoked.
Mixed or unclassifiable returns stay
quiet. The rule does not follow arrays returned by `async` helpers,
recursive return chains, arrays returned through stored variables, or
objects returned by helpers.
- A promise passed to a function the rule does not know, such as
`queue.push(...)` or `setTimeout(...)`, is left alone, since the rule cannot
tell what that function does with it.
Expand Down
Loading
Loading