A type alias only renames another named type or a primitive
What it finds
type UserId = string gives a second name to string that TypeScript treats as fully interchangeable with it, so the name suggests a distinction the compiler does not make. Using the type directly, or a branded type, is clearer.
Reported are type aliases without type parameters whose type is a primitive keyword or a single type name without type arguments.
From the rule's source, alias_of_single_type.rs.
export type UserId = string;tx0 reports: this alias only renames stringexport type Pair = [string, string]; Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/ts:alias-of-single-type" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/ts:alias-of-single-type] reason="..."tx0 explain tx0/ts:alias-of-single-type shows the same in the terminal. Found a false positive? Report it.