abortControllerInEffect
August 4, 2026 ยท View on GitHub
Warns when manually constructing AbortController inside Effect generators instead of using Effect.abortSignal
| Property | Value |
|---|---|
| Category | Effect-native |
| Default severity | suggestion |
| Fixable | No |
| Effect versions | v4 |
| Diagnostic codes | TS377111 |
| Language Service name | abortControllerInEffect |
| Oxlint name | effecttsgo/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"
}
}