Skip to content

No Unknown Type Aliases

Error
small-rules/no-unknown-type-aliases

Disallow type aliases whose resolved type is unknown; unknown must remain visible at an allowed boundary.

Rationale

Ported from dmmulroy/anti-slop. Renaming unknown hides where parsing is still required. Keep it visible at the boundary, then introduce a real domain type after validation.

Diagnostic Messages

unknownAlias
Type alias `{{alias}}` hides `unknown`. Keep `unknown` explicit at the parsing boundary or on an allowed `cause` field; otherwise use the parsed owner type.

Configuration

This rule does not accept options.

{
"jsPlugins": [
"@pobammer-ts/small-rules"
],
"rules": {
"small-rules/no-unknown-type-aliases": "error"
}
}

Examples

renamed unknown alias
type ExternalValue = unknown;
specific type alias
type User = { readonly id: string };