A type parameter is constrained to unknown or any, which every type satisfies

tx0/ts:trivial-type-constraintstrictwarningstyle

What it finds

function wrap<T extends unknown>(value: T): every type extends unknown and any, so such a constraint constrains nothing and only adds words.

The fix removes extends unknown and is safe, except in .tsx files where <T,> or a constraint keeps an arrow function's type parameters from reading as a JSX tag; there the constraint of a lone type parameter of an arrow function is left alone.

From the rule's source, trivial_type_constraint.rs.

Example from the rule's tests
function wrap<T extends unknown>(value: T) {tx0 reports: every type extends unknown, so this constrains nothing  return [value];}function keep<T extends object>(value: T) {  return value;}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

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:

tx0.toml
[rules]
"tx0/ts:trivial-type-constraint" = "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:trivial-type-constraint] reason="..."

tx0 explain tx0/ts:trivial-type-constraint shows the same in the terminal. Found a false positive? Report it.