Detects error payload fields named name that shadow the error's own name
| Property | Value |
|---|---|
| Category | Correctness |
| Default severity | suggestion |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377145 |
| Language Service name | errorPayloadShadowsName |
| Oxlint name | effecttsgo/error-payload-shadows-name |
import { Data } from "effect"
export class ToolNotFound extends Data.TaggedError("ToolNotFound")<{ readonly name: string }> {}
/**
^^^^ effecttsgo(error-payload-shadows-name): The payload field `name` shadows this error's own `name`, so logs and `String(error)` show the field value instead of the error type. Consider renaming it.
*/
new ToolNotFound({ name: "search" }).nameSee 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/error-payload-shadows-name": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "errorPayloadShadowsName": "warning" } } ] } }