Skip to content

Latest commit

 

History

History
69 lines (57 loc) · 1.61 KB

File metadata and controls

69 lines (57 loc) · 1.61 KB

effectDoNotation

Suggests using Effect.gen or Effect.fn instead of the Effect.Do notation helpers

Property Value
Category Style
Default severity off
Fixable No
Effect versions v3, v4
Diagnostic codes TS377085
Language Service name effectDoNotation
Oxlint name effecttsgo/effect-do-notation

Preview

import { Effect } from "effect"
import { pipe } from "effect/Function"

export const preview = pipe(
  Effect.Do,
/**
  ^^^^^^^^^ effecttsgo(effect-do-notation): This uses the Effect do emulation. `Effect.gen` or `Effect.fn` achieve the same result with native JS scopes.
*/
  Effect.bind("a", () => Effect.succeed(1)),
  Effect.let("b", ({ a }) => a + 1),
  Effect.bind("c", ({ b }) => Effect.succeed(b.toString()))
)

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": {
          "effectDoNotation": "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/effect-do-notation": "warn"
  }
}