abortControllerInEffect

August 4, 2026 ยท View on GitHub

Warns when manually constructing AbortController inside Effect generators instead of using Effect.abortSignal

PropertyValue
CategoryEffect-native
Default severitysuggestion
FixableNo
Effect versionsv4
Diagnostic codesTS377111
Language Service nameabortControllerInEffect
Oxlint nameeffecttsgo/abort-controller-in-effect

Preview

import { Effect } from "effect"

export const preview = Effect.gen(function*() {
  return new AbortController().signal
/**
         ^^^^^^^^^^^^^^^^^^^^^ effecttsgo(abort-controller-in-effect): `AbortController` is manually constructed inside Effect code. Use `Effect.abortSignal` for Effect-managed cancellation.
*/
})

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": {
          "abortControllerInEffect": "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/abort-controller-in-effect": "warn"
  }
}