preferUnsafeConstructor

August 4, 2026 ยท View on GitHub

Suggests replacing Effect.runSync of a pure effect constructor with the synchronous *Unsafe variant exported by the same module

PropertyValue
CategoryAnti-pattern
Default severitysuggestion
FixableYes
Effect versionsv4
Diagnostic codesTS377109
Language Service namepreferUnsafeConstructor
Oxlint nameeffecttsgo/prefer-unsafe-constructor

Preview

import { Effect, Scope } from "effect"

export const scope = Effect.runSync(Scope.make())
/**
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ effecttsgo(prefer-unsafe-constructor): `Effect.runSync(Scope.make(...))` starts a fiber to run a pure constructor. Use the synchronous variant `Scope.makeUnsafe(...)` instead.
*/

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": {
          "preferUnsafeConstructor": "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/prefer-unsafe-constructor": "warn"
  }
}