Skip to content

v0.18.0

Choose a tag to compare

@github-actions github-actions released this 30 Sep 21:32
· 54 commits to main since this release
ccc74da

Minor Changes

  • 1067cca Thanks @cevr! - Add rules ported from gent's lint plugin, and a shared test-file setting.

    Recommended preset:

    • effect/noLintEvasion: bans Option.getOrUndefined(Option.none()), Option.getOrNull(Option.none()), Schema.Schema.Type<typeof Schema.Unknown> and typeof Schema.Unknown.Type, the spellings of undefined, null and unknown that pass noNullish and noUnknownParameters.
    • effect/preferSchemaTaggedUnion: reports a union of two or more type literals with PascalCase _tag literals; declare it with Schema.TaggedUnion.
    • effect/noEffectBunTestItCall: reports a call of effect-bun-test's it, an object of runners whose call throws while the module loads.
    • effect/noPromiseChainsInTests: reports .then, .catch and .finally chains in tests; calls on Effect-package bindings stay allowed.
    • effect/noAliasTestLayer: reports a static Test/Fake/Stub/Mock (or layerTest) member whose whole value is the live layer.

    Opt-in (registered, left out of the preset; a rule opts out with meta.docs.recommended: false):

    • effect/noPositionalLogArguments: one message per Effect.log* call; attach data with Effect.annotateLogs.
    • effect/noRunPromise: reports Effect.runPromise* and runtime runPromise calls outside the boundary files an override exempts.
    • effect/noWithWrapperCall: pipe values through withX adapters instead of wrapping calls or callbacks; the allow option names exempt adapters.
    • effect/noTimeoutDieInTests: reports Effect.die whose message describes a timeout in tests.

    The shared settings.effect.testFiles globs add a project's own test code (a tests/ tree, a harness package) to every test-scoped rule, noFixedWaitInTests included. noDynamicImports now also reports an inline createRequire(import.meta.url)("x").

  • e3a5080 Thanks @cevr! - Add effect/noFixedWaitInTests: a test file may not block on wall-clock time. It reports a waited Effect.sleep, Bun.sleep/Bun.sleepSync, or setTimeout from timers/promises, any waitForTimeout(...), and a new Promise that only setTimeout settles. A sleep used as a value (a fake's latency, a forked fiber under TestClock) stays allowed. The message points to TestClock.adjust or waiting on the event (Deferred, Latch, Queue, expect.poll, waitForFunction).