overriddenSchemaConstructor

August 4, 2026 ยท View on GitHub

Prevents overriding constructors in Schema classes which breaks decoding behavior

PropertyValue
CategoryCorrectness
Default severityerror
FixableYes
Effect versionsv3, v4
Diagnostic codesTS377044
Language Service nameoverriddenSchemaConstructor
Oxlint nameeffecttsgo/overridden-schema-constructor

Preview

import * as Schema from "effect/Schema"

export class User extends Schema.Class<User>("User")({ name: Schema.String }) {
  constructor(readonly input: { name: string }) { super(input) }
/**
  ^^^^^^^^^^^ effecttsgo(overridden-schema-constructor): This Schema subclass defines its own constructor. For Schema classes, constructor overrides break decoding behavior for the class shape. Custom construction can be expressed through a static `new` method instead.
*/
}

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": {
          "overriddenSchemaConstructor": "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/overridden-schema-constructor": "warn"
  }
}