github Effect-TS/tsgo @effect/tsgo@0.69.0

one hour ago

Minor Changes

  • 647cd77: Add the opt-in missingConcurrencyOption diagnostic in style. Effect.all and Effect.forEach run sequentially unless concurrency is set, which readers coming from Promise.all often do not expect. The rule reports calls whose options argument is missing or is an object literal without a concurrency key, in every spelling: data-first, data-last in a pipe, curried, and inside Effect.gen / Effect.fn bodies.

    yield* Effect.forEach(items, save)                      // reported
    yield* Effect.forEach(items, save, { concurrency: 1 })  // ok
    yield* Effect.all(checks, { concurrency: 4 })           // ok

    A quick fix adds concurrency: 1, which keeps the current behaviour: Effect.forEach(items, save) becomes Effect.forEach(items, save, { concurrency: 1 }), and Effect.all(checks, { discard: true }) becomes Effect.all(checks, { discard: true, concurrency: 1 }). Options that are not an object literal, or that use a spread, are not reported. A literal under as const, as or satisfies is checked like a bare one; under satisfies the call is reported without the quick fix, since adding concurrency may not satisfy the type. The rule defaults to off and supports Effect v3 and v4.

    Piping flows now recognize Effect v4's forEach as a dual, so Effect.forEach(items, f) and Effect.forEach(f)(items) normalize like they do on v3.

Patch Changes

  • 0f776a9: Fix schemaNumber false positives for isInt() and isFinite() checks wrapped in .abort() or combined with .and(...). .abort() keeps the filter's predicate and X.and(Y) runs both filters, so the schema still rejects NaN, Infinity and -Infinity, like the bare filter and the .annotate(...) form, which was already accepted. A finite filter on either side of .and(...) counts, and the wrappers can be chained in any order, in .check(...) and in piped Schema.check(...).

    Schema.Number.check(Schema.isInt().abort())                              // no longer reported
    Schema.Number.check(Schema.isFinite().abort(), Schema.isBetween({ minimum: 1, maximum: 24 })) // no longer reported
    Schema.Number.check(Schema.isInt().and(Schema.isGreaterThan(0)))         // no longer reported
    Schema.Number.check(Schema.isGreaterThan(0).and(Schema.isInt()))         // no longer reported
    Schema.Number.check(Schema.isGreaterThan(0).abort())                     // still reported
  • f374280: Update the TypeScript next tag to typescript@next, which ships typescript-go commit ad24728023c52ef6a92a278046cdb69621048365, update the TypeScript beta tag to typescript@beta, and update the TypeScript latest tag to typescript@latest.

Don't miss a new tsgo release

NewReleases is sending notifications on new releases.