schemaNumber

September 2, 2026 ยท View on GitHub

Suggests Schema.Finite and Schema.FiniteFromString instead of Schema.Number APIs when describing domain numbers

PropertyValue
CategoryStyle
Default severitysuggestion
FixableYes
Effect versionsv4
Diagnostic codesTS377098
Language Service nameschemaNumber
Oxlint nameeffecttsgo/schema-number

Preview

import { Schema } from "effect"

export const User = Schema.Struct({
  age: Schema.Number,
/**
              ^^^^^^ effecttsgo(schema-number): This Schema number API accepts `NaN`, `Infinity`, and `-Infinity`. Use `Schema.Finite` for finite domain numbers. If non-finite values are intentional, disable this diagnostic for that line.
*/
  score: Schema.NumberFromString,
/**
                ^^^^^^^^^^^^^^^^ effecttsgo(schema-number): This Schema number API accepts `NaN`, `Infinity`, and `-Infinity`. Use `Schema.FiniteFromString` for finite domain numbers. If non-finite values are intentional, disable this diagnostic for that line.
*/
  integer: Schema.Number.check(Schema.isInt()),
  pipedFinite: Schema.Number.pipe(Schema.check(Schema.isFinite()))
})

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": {
          "schemaNumber": "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-number": "warn"
  }
}