Repository navigation
v0.18.0
Minor Changes
-
1067ccaThanks @cevr! - Add rules ported from gent's lint plugin, and a shared test-file setting.Recommended preset:
effect/noLintEvasion: bansOption.getOrUndefined(Option.none()),Option.getOrNull(Option.none()),Schema.Schema.Type<typeof Schema.Unknown>andtypeof Schema.Unknown.Type, the spellings ofundefined,nullandunknownthat passnoNullishandnoUnknownParameters.effect/preferSchemaTaggedUnion: reports a union of two or more type literals with PascalCase_tagliterals; declare it withSchema.TaggedUnion.effect/noEffectBunTestItCall: reports a call of effect-bun-test'sit, an object of runners whose call throws while the module loads.effect/noPromiseChainsInTests: reports.then,.catchand.finallychains in tests; calls on Effect-package bindings stay allowed.effect/noAliasTestLayer: reports astatic Test/Fake/Stub/Mock(orlayerTest) 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 perEffect.log*call; attach data withEffect.annotateLogs.effect/noRunPromise: reportsEffect.runPromise*and runtimerunPromisecalls outside the boundary files an override exempts.effect/noWithWrapperCall: pipe values throughwithXadapters instead of wrapping calls or callbacks; theallowoption names exempt adapters.effect/noTimeoutDieInTests: reportsEffect.diewhose message describes a timeout in tests.
The shared
settings.effect.testFilesglobs add a project's own test code (atests/tree, a harness package) to every test-scoped rule,noFixedWaitInTestsincluded.noDynamicImportsnow also reports an inlinecreateRequire(import.meta.url)("x"). -
e3a5080Thanks @cevr! - Addeffect/noFixedWaitInTests: a test file may not block on wall-clock time. It reports a waitedEffect.sleep,Bun.sleep/Bun.sleepSync, orsetTimeoutfromtimers/promises, anywaitForTimeout(...), and anew Promisethat onlysetTimeoutsettles. A sleep used as a value (a fake's latency, a forked fiber underTestClock) stays allowed. The message points toTestClock.adjustor waiting on the event (Deferred, Latch, Queue,expect.poll,waitForFunction).