Suggests Effect.isSuccess or Effect.isFailure when Effect.match or Effect.matchEager folds to complementary boolean literals
| Property | Value |
|---|---|
| Category | Style |
| Default severity | suggestion |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377173, TS377174 |
| Language Service name | matchBooleanToIsSuccess |
| Oxlint name | effecttsgo/match-boolean-to-is-success |
import { Effect } from "effect"
declare const saveUser: Effect.Effect<void, Error>
export const saved = Effect.match(saveUser, {
/**
^^^^^^^^^^^^ effecttsgo(match-boolean-to-is-success): `Effect.isSuccess` expresses this check more directly than `Effect.match` folding to complementary boolean literals.
*/
onFailure: () => false,
onSuccess: () => true
})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/match-boolean-to-is-success": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "matchBooleanToIsSuccess": "warning" } } ] } }