Warns when Schema classes, errors, or Opaque classes omit the brand type argument
| Property | Value |
|---|---|
| Category | Correctness |
| Default severity | suggestion |
| Fixable | No |
| Effect versions | v4 |
| Diagnostic codes | TS377141 |
| Language Service name | schemaClassMissingBrand |
| Oxlint name | effecttsgo/schema-class-missing-brand |
import { Schema } from "effect"
export class User extends Schema.Class<User>("User")({ name: Schema.String }) {}
/**
^^^^ effecttsgo(schema-class-missing-brand): Add `{ readonly brand: unique symbol }` as the second type argument. Without a brand, TypeScript may accept structurally compatible values where this class instance type is expected.
*/
export class StructuralUser extends Schema.Class<StructuralUser, {}>("StructuralUser")({ name: Schema.String }) {}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-class-missing-brand": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "schemaClassMissingBrand": "warning" } } ] } }