Skip to content

v0.29.0

Latest

Choose a tag to compare

@github-actions github-actions released this 16 Oct 01:02
a5bbbf8

Minor Changes

  • #64 f348e20 Thanks @cevr! - requireForceKillAfter reads a parameter that holds an array as the command's arguments, not its options: make(cmd, args) with args a rest parameter, or a parameter typed T[], readonly T[], Array<T> or ReadonlyArray<T>, names no forceKillAfter and is reported, as make(cmd, ["arg"]) is. An untyped parameter may hold the options and is still left alone.

  • #64 f348e20 Thanks @cevr! - requireForceKillAfter names the signal the spawner sends on interrupt or timeout: SIGTERM when the command names no killSignal, else the command's killSignal as written, or "the command's killSignal" when the rule cannot read it. A command whose killSignal is "SIGKILL" (or 9) cannot be ignored and is not reported.

  • #64 f348e20 Thanks @cevr! - noGlobals follows every hop of the global object to itself: a page's top, parent and frames, a chain of its own names (globalThis.window, window.top), and document.defaultView, so parent.fetch() and document.defaultView.setTimeout() are reported. A watched global held where the walk cannot follow it ({ w: window }, [document], () => performance, mine ?? globalThis, a return) is now reported as a use; handing it to a call or a new stays allowed, alone, inside an object or array literal, or as what a function handed to one gives back, by an arrow's body or a return (createClient({ fetch }), new Client({ fetch }), take([window]), Reference({ defaultValue: () => globalThis.fetch }), createClient({ getFetch() { return fetch; } })), since that is how an adapter is built over it; a return from a function that is not handed to a call is still a hold. A held global object is reported only while a ban on some member is active, so builtins: false with no members, or with a global whose bans name no member (Bun: []), reports none. members takes a list of bans for one global, so its members can name different replacements, and a configured ban's use is named before the built-in one.

    New recommended rule noPointFreeLog: a logger that prints every argument it is given (console.log, info, warn, error, debug and trace, effect's Console members of the same names, and Effect.log, logFatal, logError, logWarning, logInfo, logDebug and logTrace) handed point-free, in a callback's place, to a call that passes its callback an index prints the index after each line; call it in a callback, (line) => Console.log(line). The calls the rule reads are Effect.forEach, Effect.filter and Effect.partition, effect's Array module, and an array literal's methods, each at its callback's place only (a thisArg or a seed is not called). A reducer (reduce, reduceRight) is passed the accumulator first, and its report says so. The rule does not read effect's other modules (Exit, Option, Stream, Chunk, Iterable): a logger handed to one of their members is not reported. A method of an array's name on a receiver the rule cannot see (xs.map(console.log)) is reported with what prints if xs is an array. console.count, time, table and dir take a label, a column filter or options and are not reported.

    New opt-in rule requireSpawnBudget: a test (it, test and their members, such as it.effect, it.skip and effect-bun-test's it.effect.layer(L), from bun:test, effect-bun-test, vitest, @effect/vitest or the global) whose body calls a process starter (Bun's spawn/spawnSync, node:child_process) or effect's ChildProcess.make, itself or through a function of the same file, names its timeout: a number after its body, or { timeout } in its options before the body (Vitest's it(name, { timeout }, body)) or after it; a suite's { timeout } is its tests' budget too. A suite (describe, suite, test.describe), @effect/vitest's layer group (it.layer(L)(…), layer(L)(…)), a fixture builder (test.extend, test.override) and a hook (beforeEach and the rest) is not a test; a test on a group factory's parameter is judged on its own. The report names the call the test makes, and the function of the file it makes it through; for ChildProcess.make it says the command starts a process when a platform spawner runs it. minimum also reports a timeout the rule reads as a number below that minimum.

Patch Changes

  • #64 f348e20 Thanks @cevr! - noInterruptibleMemo leaves the recommended preset and is opt-in, and its message now says what each memoizer does on each effect 4.x. Effect 4.0.0 runs a cached effect in its first caller's fiber and keeps the exit it reaches, so later callers get that caller's interruption back while the entry lives: for Effect.cached from then on, for cachedWithTTL and cachedInvalidateWithTTL until the time to live given for that exit ends or the entry is invalidated. From 4.0.1 the run is a fiber of its own: a run that every caller has left is interrupted and never cached, and the next caller starts a new one, so a run an interruption cannot stop (a promise with no signal, an engine's start) goes on beside it. The fix it names is the same for both: fork the run once into a scope that owns it and Fiber.join it in each caller. It no longer names Cache, which also gives up a lookup its callers leave. A namespace named Effect imported from another module is not effect's and is not reported. The devDependency on effect is 4.0.5, and tests hold the message to what each memoizer does on effect 4.0.0 and on 4.0.5.