schemaNumber
September 2, 2026 ยท View on GitHub
Suggests Schema.Finite and Schema.FiniteFromString instead of Schema.Number APIs when describing domain numbers
| Property | Value |
|---|---|
| Category | Style |
| Default severity | suggestion |
| Fixable | Yes |
| Effect versions | v4 |
| Diagnostic codes | TS377098 |
| Language Service name | schemaNumber |
| Oxlint name | effecttsgo/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"
}
}