extendsNativeError

August 4, 2026 ยท View on GitHub

Warns when a class directly extends the native Error class

PropertyValue
CategoryEffect-native
Default severityoff
FixableNo
Effect versionsv3, v4
Diagnostic codesTS377055
Language Service nameextendsNativeError
Oxlint nameeffecttsgo/extends-native-error

Preview

export class PreviewError extends Error {}
/**
             ^^^^^^^^^^^^ effecttsgo(extends-native-error): This class extends the native `Error` type directly. Untagged native errors lose distinction in the Effect failure channel.
*/

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": {
          "extendsNativeError": "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/extends-native-error": "warn"
  }
}