Suggests replacing Effect.runSync of a pure effect constructor with the synchronous *Unsafe variant exported by the same module
| Property | Value |
|---|---|
| Category | Anti-pattern |
| Default severity | suggestion |
| Fixable | Yes |
| Effect versions | v4 |
| Diagnostic codes | TS377109 |
| Language Service name | preferUnsafeConstructor |
| Oxlint name | effecttsgo/prefer-unsafe-constructor |
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.
*/See the Language Service setup guide for installation instructions.
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"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "preferUnsafeConstructor": "warning" } } ] } }