Detects unsafe type assertions that narrow Effect, Stream, or Layer error or requirements channels
| Property | Value |
|---|---|
| Category | Effect-native |
| Default severity | off |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377075 |
| Language Service name | unsafeEffectTypeAssertion |
| Oxlint name | effecttsgo/unsafe-effect-type-assertion |
import { Effect } from "effect"
declare const program: Effect.Effect<string, "boom", "service">
export const preview = program as Effect.Effect<string, never, never>
/**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ effecttsgo(unsafe-effect-type-assertion): This type assertion unsafely narrows the error or requirements channels.
*/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/unsafe-effect-type-assertion": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "unsafeEffectTypeAssertion": "warning" } } ] } }