eslint-plugin-fp-ts
eslint-plugin-fp-ts copied to clipboard
Prefer pipe to nested call expressions
import { pipe } from "fp-ts/function";
declare const a: (n: number) => number;
declare const b: (n: number) => number;
declare const c: (n: number) => number;
// ❌
c(b(a(1)));
// ✅
pipe(1, a, b, c);
Opinions on?
import { pipe } from "fp-ts/function";
declare const a: (n: number) => number;
// ❌
pipe(1, a);
// ✅
a(1);
@mlegenhausen I was about to comment the same thing! I'd personally prefer a(1)
until a second function is applied, then preferring pipe
.