Suggests using Schema make instead of new for Schema classes
| Property | Value |
|---|---|
| Category | Style |
| Default severity | off |
| Fixable | Yes |
| Effect versions | v4 |
| Diagnostic codes | TS377094 |
| Language Service name | newSchemaClass |
| Oxlint name | effecttsgo/new-schema-class |
import { Schema } from "effect"
class User extends Schema.Class<User>("User")({ name: Schema.String }) {}
export const preview = new User({ name: "John" })
/**
^^^^ effecttsgo(new-schema-class): This Schema class is constructed with `new`. `User.make(...)` can be used to construct the Schema class instance.
*/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/new-schema-class": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "newSchemaClass": "warning" } } ] } }