Suggests using Effect.succeed instead of Effect.sync when the thunk returns a constant value
| Property | Value |
|---|---|
| Category | Style |
| Default severity | suggestion |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377103 |
| Language Service name | syncToSucceed |
| Oxlint name | effecttsgo/sync-to-succeed |
import { Effect } from "effect"
export const preview = Effect.sync(() => "constant")
/**
^^^^^^^^^^^ effecttsgo(sync-to-succeed): `Effect.succeed` expresses this constant value more directly than `Effect.sync`.
*/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/sync-to-succeed": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "syncToSucceed": "warning" } } ] } }