Skip to content

typescript/no-this-alias Correctness

This rule is turned on by default.

What it does

Disallow unnecessary constraints on generic types.

Why is this bad?

Generic type parameters (<T>) in TypeScript may be "constrained" with an extends keyword. When no extends is provided, type parameters default a constraint to unknown. It is therefore redundant to extend from any or unknown.

the rule doesn't allow const {allowedName} = this this is to keep 1:1 with eslint implementation sampe with obj.<allowedName> = this



## References
- [Rule Source](https://github.com/oxc-project/oxc/blob/25ddb3519289dfe2a51e53b9b0c355d8ad950bbc/crates/oxc_linter/src/rules/typescript/no_this_alias.rs)

Released under the MIT License.