Suggests replacing typeof Schema.Type style annotations with the matching named type when available
| Property | Value |
|---|---|
| Category | Style |
| Default severity | suggestion |
| Fixable | Yes |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377090 |
| Language Service name | unnecessaryTypeofType |
| Oxlint name | effecttsgo/unnecessary-typeof-type |
import { Schema } from "effect"
export namespace UsersRepo {
export const User = Schema.Struct({ id: Schema.Finite })
export type User = typeof User.Type
}
export const preview: typeof UsersRepo.User.Type = { id: 1 }
/**
^^^^^^^^^^^^^^^^^^^^^^^^^^ effecttsgo(unnecessary-typeof-type): This `typeof ... .Type` query can be replaced with `UsersRepo.User`.
*/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/unnecessary-typeof-type": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "unnecessaryTypeofType": "warning" } } ] } }