schemaSyncInEffect

August 27, 2026 ยท View on GitHub

Suggests using Effect-based Schema methods instead of sync methods inside Effect generators

PropertyValue
CategoryAnti-pattern
Default severitysuggestion
FixableNo
Effect versionsv3, v4
Diagnostic codesTS377037
Language Service nameschemaSyncInEffect
Oxlint nameeffecttsgo/schema-sync-in-effect

Preview

import * as Effect from "effect/Effect"
import * as Schema from "effect/Schema"

const Person = Schema.Struct({ name: Schema.String, age: Schema.Finite })

export const preview = Effect.gen(function*() {
  const input = yield* Effect.succeed({ name: "Ada", age: 1 })
  return Schema.decodeSync(Person)(input)
/**
         ^^^^^^^^^^^^^^^^^ effecttsgo(schema-sync-in-effect): `Schema.decodeSync` is used inside an Effect generator. `Schema.decode` preserves the typed Effect error channel for this operation without throwing.
*/
})

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": {
          "schemaSyncInEffect": "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/schema-sync-in-effect": "warn"
  }
}