classSelfMismatch
August 4, 2026 ยท View on GitHub
Ensures Self type parameter matches the class name in Context/Service/Tag/Schema classes
| Property | Value |
|---|---|
| Category | Correctness |
| Default severity | error |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377046 |
| Language Service name | classSelfMismatch |
| Oxlint name | effecttsgo/class-self-mismatch |
Preview
import * as Effect from "effect/Effect"
interface ServiceShape { value: number }
export class InvalidContextTag
extends Effect.Tag("ValidContextTag")<ValidContextTag, ServiceShape>() {}
/**
^^^^^^^^^^^^^^^ effecttsgo(class-self-mismatch): The `Self` type parameter for this class should be `InvalidContextTag`.
*/
declare class ValidContextTag {}
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": {
"classSelfMismatch": "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/class-self-mismatch": "warn"
}
}