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/main/crates/oxc_linter/src/rules/typescript/no_this_alias.rs)

Released under the MIT License.