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 |
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.
*/See the Language Service setup guide for installation instructions.
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"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "schemaLiteralNonFinite": "warning" } } ] } }