Skip to content

Latest commit

 

History

History
67 lines (54 loc) · 1.52 KB

catch-to-ignore.md

File metadata and controls

67 lines (54 loc) · 1.52 KB

catchToIgnore

Suggests using Effect.ignore or Effect.ignoreCause instead of Effect.catch/catchCause returning Effect.void

Property Value
Category Style
Default severity suggestion
Fixable Yes
Effect versions v4
Diagnostic codes TS377099
Language Service name catchToIgnore
Oxlint name effecttsgo/catch-to-ignore

Preview

import { Effect } from "effect"

declare const program: Effect.Effect<void, string, never>

export const recovered = program.pipe(
  Effect.catch(() => Effect.void)
/**
  ^^^^^^^^^^^^ effecttsgo(catch-to-ignore): `Effect.ignore` expresses ignored failure more directly than `Effect.catch` returning `Effect.void`.
*/
)

Language Service Configuration

See the Language Service setup guide for installation instructions.

{
  "$schema": "./node_modules/@effect/tsgo/schema.json",
  "compilerOptions": {
    "plugins": [
      {
        "name": "@effect/language-service",
        "diagnosticSeverity": {
          "catchToIgnore": "warning"
        }
      }
    ]
  }
}

Oxlint Configuration

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/catch-to-ignore": "warn"
  }
}