Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 1 KB

File metadata and controls

52 lines (35 loc) · 1 KB

eslint/no-delete-var

This rule is turned on by default.

What it does

The purpose of the delete operator is to remove a property from an object.

Why is this bad?

Using the delete operator on a variable might lead to unexpected behavior.

Example

Examples of incorrect code for this rule:

var x;
delete x;

How to use

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

::: code-group

oxlint --deny no-delete-var
{
  "rules": {
    "no-delete-var": "error"
  }
}

:::

References