Skip to content

Latest commit

 

History

History
65 lines (53 loc) · 1.51 KB

effect-gen-uses-adapter.md

File metadata and controls

65 lines (53 loc) · 1.51 KB

effectGenUsesAdapter

Warns when using the deprecated adapter parameter in Effect.gen

Property Value
Category Anti-pattern
Default severity warning
Fixable No
Effect versions v3, v4
Diagnostic codes TS377027
Language Service name effectGenUsesAdapter
Oxlint name effecttsgo/effect-gen-uses-adapter

Preview

import * as Effect from "effect/Effect"

export const preview = Effect.gen(function*(_) {
/**
                                            ^ effecttsgo(effect-gen-uses-adapter): The adapter of Effect.gen is not required anymore, it is now just an alias of pipe.
*/
  return yield* Effect.succeed(1)
})

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": {
          "effectGenUsesAdapter": "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-gen-uses-adapter": "warn"
  }
}