Skip to content

Latest commit

 

History

History
61 lines (50 loc) · 1.42 KB

extends-native-error.md

File metadata and controls

61 lines (50 loc) · 1.42 KB

extendsNativeError

Warns when a class directly extends the native Error class

Property Value
Category Effect-native
Default severity off
Fixable No
Effect versions v3, v4
Diagnostic codes TS377055
Language Service name extendsNativeError
Oxlint name effecttsgo/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"
  }
}