TRAITS

construct-values-inside-pipelines

Keep final value construction inside a transformation pipeline rather than wrapping the pipeline in a constructor call: use pipe(values, transform, (items) => new Set(items)), not new Set(pipe(values, transform)). This also applies to other constructors when the construction is the final transformation.

Applies when
constructing a final value from a transformation pipeline.
File types
  • TypeScript
  • TSX
ID
1ba43d83-6e85-4314-a214-4ca42daade6a
Source
.agents/traits/construct-values-inside-pipelines-1ba43d83-6e85-4314-a214-4ca42daade6a.md

Skipping this trait

Add this comment before any code to skip the trait for a whole file. A reason is required.

File header
// traits-ignore-file 1ba43d83-6e85-4314-a214-4ca42daade6a: <reason>