Suggests Effect.fromResult when Result.match or a Result guard conditional only converts Success to Effect.succeed and Failure to Effect.fail
| Property | Value |
|---|---|
| Category | Style |
| Default severity | suggestion |
| Fixable | Yes |
| Effect versions | v4 |
| Diagnostic codes | TS377165 |
| Language Service name | resultMatchToFromResult |
| Oxlint name | effecttsgo/result-match-to-from-result |
import { Effect, Result } from "effect"
declare const parsePort: (raw: string) => Result.Result<number, Error>
export const port = Result.match(parsePort("8080"), {
/**
^^^^^^^^^^^^ effecttsgo(result-match-to-from-result): `Effect.fromResult` expresses this Result-to-Effect conversion more directly than `Result.match` or a Result guard conditional.
*/
onFailure: (error) => Effect.fail(error),
onSuccess: (value) => Effect.succeed(value)
})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/result-match-to-from-result": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "resultMatchToFromResult": "warning" } } ] } }