TypeScript · TS0003
Keep unknown visible at its boundary
Reject type aliases that only conceal TypeScript's unknown type.
typescript/evidence/no-unknown-type-aliasessrc/rule-packs/typescript/rules/no-unknown-type-aliases.ts Upstream docs Run this rule
pnpm vite-doctor . --extends auto,typescript/strict --rules typescript/evidence/no-unknown-type-aliases
Why it matters
Renaming unknown makes an unparsed value look like a domain contract without adding evidence. Callers still cannot use the value safely, but the alias hides where parsing belongs.
Recommended fix
Keep unknown explicit at the input boundary, then return a parsed owner type.
Useful links
Example
Parse an external value
Before
type ExternalUser = unknown
After
type User = z.infer<typeof UserSchema>