preferSchemaTypeProperty

August 4, 2026 ยท View on GitHub

Disallows Schema.Schema.Type in favor of typeof X.Type

PropertyValue
CategoryStyle
Default severityoff
FixableYes
Effect versionsv3, v4
Diagnostic codesTS377104
Language Service namepreferSchemaTypeProperty
Oxlint nameeffecttsgo/prefer-schema-type-property

Preview

import { Schema } from "effect"

const User = Schema.Struct({ name: Schema.String })
type User = Schema.Schema.Type<typeof User>
/**
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ effecttsgo(prefer-schema-type-property): Do not use `Schema.Schema.Type<typeof X>` to extract a schema's type. Use `typeof X.Type` 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": {
          "preferSchemaTypeProperty": "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/prefer-schema-type-property": "warn"
  }
}