Suggests Effect.failSync/dieSync instead of Effect.suspend wrapping a single Effect.fail/die
| Property | Value |
|---|---|
| Category | Style |
| Default severity | suggestion |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377163 |
| Language Service name | suspendFailToFailSync |
| Oxlint name | effecttsgo/suspend-fail-to-fail-sync |
import { Data, Effect } from "effect"
class ValidationError extends Data.TaggedError("ValidationError")<{
readonly input: string
}> {}
export const rejectInput = (input: string) => Effect.suspend(() => Effect.fail(new ValidationError({ input })))
/**
^^^^^^^^^^^^^^ effecttsgo(suspend-fail-to-fail-sync): `Effect.failSync` builds this error lazily directly instead of wrapping `Effect.fail` in `Effect.suspend`.
*/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/suspend-fail-to-fail-sync": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "suspendFailToFailSync": "warning" } } ] } }