Repository navigation
Patch Changes
-
387dd4f:
missedPipeableOpportunityno longer suggests.pipe(...)on values whosepipemethod does not take functions, such as a Node.jsReadablestream. A receiver is now reported only when some call signature of itspipeaccepts one function argument per step of the suggested pipe:import { Readable } from "node:stream" import { identity } from "effect/Function" import * as Option from "effect/Option" declare const stream: Readable // before: reported, and the quick fix produced `stream.pipe(identity, Option.some)`, which does not compile // after: not reported Option.some(identity(stream))
-
5103cb8: Keep comments when the
missedPipeableOpportunityquick fix rewrites nested calls into.pipe(...). Previously every comment inside the rewritten expression was deleted.export const direct = identity( // Keep this reason with the inner call. identity(source) )
now becomes
export const direct = source.pipe( // Keep this reason with the inner call. identity, identity)
-
e95239a:
missedPipeableOpportunityno longer suggests passing an overloaded function point-free to.pipe. A direct call picks the overload that fits its argument, but in the pipe form the function is passed as a value and TypeScript infers from its last overload, so the suggested fix could fail to type-check or widen the result. A call to an overloaded function (or a dual such asGraph.topo) with no arguments of its own now ends the pipeable run. The calls before it are still reported, and curried calls such asEffect.map(f)(self)are unaffected:import { Schema } from "effect" declare const schema: Schema.Schema<number> declare function withTitle<A>(schema: Schema.Schema<A>): Schema.Schema<A> declare function jsonOf<A>(schema: Schema.Schema<A>): Schema.Schema<A> declare function jsonOf(options: { readonly space: number }): Schema.Schema<unknown> // before: reported, and the fix produced `schema.pipe(withTitle, jsonOf)`, which does not compile // after: not reported export const direct = jsonOf(withTitle(schema)) // reported on the run before the overloaded call: `jsonOf(schema.pipe(withTitle, withTitle))` export const before = jsonOf(withTitle(withTitle(schema)))
-
2c3aadc: The
togglePipeStylerefactor no longer offers "Rewrite as X.pipe(Y, Z, ...)" when the subject'spipemethod does not take the piped functions, such as a Node.jsReadablestream. It is offered only when some call signature of the subject'spipeaccepts one function argument per piped step, the same checkmissedPipeableOpportunityuses:import { Readable } from "node:stream" import { identity, pipe } from "effect/Function" import * as Option from "effect/Option" declare const stream: Readable // before: offered, and produced `stream.pipe(identity, Option.some)`, which does not compile // after: not offered pipe(stream, identity, Option.some)