Suggests using Schema.is instead of instanceof for Effect Schema types
| Property | Value |
|---|---|
| Category | Effect-native |
| Default severity | off |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377042 |
| Language Service name | instanceOfSchema |
| Oxlint name | effecttsgo/instance-of-schema |
import { Schema as S } from "effect"
class User extends S.Class<User>("User")({ name: S.String }) {}
declare const value: unknown
export const preview = value instanceof User
/**
^^^^^^^^^^^^^^^^^^^^^ effecttsgo(instance-of-schema): This code uses `instanceof` with an Effect Schema type. `Schema.is` is the schema-aware runtime check for this case.
*/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/instance-of-schema": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "instanceOfSchema": "warning" } } ] } }