newSchemaClass

August 4, 2026 ยท View on GitHub

Suggests using Schema make instead of new for Schema classes

PropertyValue
CategoryStyle
Default severityoff
FixableYes
Effect versionsv4
Diagnostic codesTS377094
Language Service namenewSchemaClass
Oxlint nameeffecttsgo/new-schema-class

Preview

import { Schema } from "effect"

class User extends Schema.Class<User>("User")({ name: Schema.String }) {}

export const preview = new User({ name: "John" })
/**
                           ^^^^ effecttsgo(new-schema-class): This Schema class is constructed with `new`. `User.make(...)` can be used to construct the Schema class instance.
*/

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": {
          "newSchemaClass": "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/new-schema-class": "warn"
  }
}