schemaOpaqueInstanceMember

August 4, 2026 ยท View on GitHub

Disallows instance members in classes extending Schema.Opaque

PropertyValue
CategoryCorrectness
Default severityerror
FixableNo
Effect versionsv4
Diagnostic codesTS377102
Language Service nameschemaOpaqueInstanceMember
Oxlint nameeffecttsgo/schema-opaque-instance-member

Preview

import { Schema } from "effect"

class User extends Schema.Opaque<User>()(Schema.Struct({ name: Schema.String })) {
  displayName = "User"
/**
  ^^^^^^^^^^^ effecttsgo(schema-opaque-instance-member): Classes extending `Schema.Opaque` must not declare instance members.
*/
  greet() {
/**
  ^^^^^
*/
    return `Hello, ${this.displayName}`
  }
}

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": {
          "schemaOpaqueInstanceMember": "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/schema-opaque-instance-member": "warn"
  }
}