Repository navigation
Minor Changes
-
#64
f348e20Thanks @cevr! -requireForceKillAfterreads a parameter that holds an array as the command's arguments, not its options:make(cmd, args)withargsa rest parameter, or a parameter typedT[],readonly T[],Array<T>orReadonlyArray<T>, names noforceKillAfterand is reported, asmake(cmd, ["arg"])is. An untyped parameter may hold the options and is still left alone. -
#64
f348e20Thanks @cevr! -requireForceKillAfternames the signal the spawner sends on interrupt or timeout: SIGTERM when the command names nokillSignal, else the command'skillSignalas written, or "the command's killSignal" when the rule cannot read it. A command whosekillSignalis"SIGKILL"(or9) cannot be ignored and is not reported. -
#64
f348e20Thanks @cevr! -noGlobalsfollows every hop of the global object to itself: a page'stop,parentandframes, a chain of its own names (globalThis.window,window.top), anddocument.defaultView, soparent.fetch()anddocument.defaultView.setTimeout()are reported. A watched global held where the walk cannot follow it ({ w: window },[document],() => performance,mine ?? globalThis, areturn) is now reported as a use; handing it to a call or anewstays allowed, alone, inside an object or array literal, or as what a function handed to one gives back, by an arrow's body or areturn(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; areturnfrom 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, sobuiltins: falsewith nomembers, or with a global whose bans name no member (Bun: []), reports none.memberstakes a list of bans for one global, so its members can name different replacements, and a configured ban'suseis named before the built-in one.New recommended rule
noPointFreeLog: a logger that prints every argument it is given (console.log,info,warn,error,debugandtrace, effect'sConsolemembers of the same names, andEffect.log,logFatal,logError,logWarning,logInfo,logDebugandlogTrace) 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 areEffect.forEach,Effect.filterandEffect.partition, effect'sArraymodule, and an array literal's methods, each at its callback's place only (athisArgor 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 ifxsis an array.console.count,time,tableanddirtake a label, a column filter or options and are not reported.New opt-in rule
requireSpawnBudget: a test (it,testand their members, such asit.effect,it.skipand effect-bun-test'sit.effect.layer(L), frombun:test,effect-bun-test,vitest,@effect/vitestor the global) whose body calls a process starter (Bun'sspawn/spawnSync,node:child_process) or effect'sChildProcess.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'sit(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 (beforeEachand 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; forChildProcess.makeit says the command starts a process when a platform spawner runs it.minimumalso reports a timeout the rule reads as a number below that minimum.
Patch Changes
- #64
f348e20Thanks @cevr! -noInterruptibleMemoleaves 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: forEffect.cachedfrom then on, forcachedWithTTLandcachedInvalidateWithTTLuntil 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 andFiber.joinit in each caller. It no longer namesCache, which also gives up a lookup its callers leave. A namespace namedEffectimported 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.