Skip to content

Latest commit

 

History

History
63 lines (51 loc) · 1.58 KB

schema-literal-non-finite.md

File metadata and controls

63 lines (51 loc) · 1.58 KB

schemaLiteralNonFinite

Reports statically known non-finite numbers passed to Schema literal constructors

Property Value
Category Correctness
Default severity error
Fixable No
Effect versions v4
Diagnostic codes TS377106
Language Service name schemaLiteralNonFinite
Oxlint name effecttsgo/schema-literal-non-finite

Preview

import { Schema } from "effect"

export const InvalidStatus = Schema.Literals([0, 1, NaN])
/**
                                                    ^^^ effecttsgo(schema-literal-non-finite): Schema literal values must be finite numbers; `NaN` throws during schema construction. Use a finite literal or model non-finite values with a refined Schema.Number.
*/

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": {
          "schemaLiteralNonFinite": "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-literal-non-finite": "warn"
  }
}