Skip to content

Latest commit

 

History

History
64 lines (52 loc) · 1.67 KB

missed-pipeable-opportunity.md

File metadata and controls

64 lines (52 loc) · 1.67 KB

missedPipeableOpportunity

Suggests using .pipe() for nested function calls

Property Value
Category Style
Default severity off
Fixable Yes
Effect versions v3, v4
Diagnostic codes TS377050
Language Service name missedPipeableOpportunity
Oxlint name effecttsgo/missed-pipeable-opportunity

Preview

import { identity, Schema } from "effect"

const User = Schema.Struct({ id: Schema.Finite })
export const preview = identity(identity(Schema.decodeEffect(User)({ id: 1 })))
/**
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ effecttsgo(missed-pipeable-opportunity): This nested call structure has a pipeable form. `Schema.decodeEffect(User)({ id: 1 }).pipe(...)` represents the same call sequence in pipe style and may be easier to read.
*/

Language Service Configuration

See the Language Service setup guide for installation instructions.

{
  "$schema": "./node_modules/@effect/tsgo/schema.json",
  "compilerOptions": {
    "plugins": [
      {
        "name": "@effect/language-service",
        "diagnosticSeverity": {
          "missedPipeableOpportunity": "warning"
        }
      }
    ]
  }
}

Oxlint Configuration

See the Oxlint setup guide for installation and patching instructions.

{
  "$schema": "./node_modules/@effect/tsgo/oxlint-schema.json",
  "options": {
    "typeAware": true
  },
  "plugins": ["effecttsgo"],
  "rules": {
    "effecttsgo/missed-pipeable-opportunity": "warn"
  }
}