Skip to content

typescript/no-this-alias Correctness ​

✅ This rule is turned on by default.

What it does ​

Disallow aliasing this

Why is this bad? ​

Assigning a variable to this instead of properly using arrow lambdas may be a symptom of pre-ES6 practices or not managing scope well.

## How to use

To **enable** this rule in the CLI or using the config file, you can use:

::: code-group

```bash [CLI]
oxlint --deny typescript/no-this-alias
Config (.oxlintrc.json)
json
{
  "rules": {
    "typescript/no-this-alias": "error"
  }
}

:::

References ​

Released under the MIT License.