mirror of
https://git.proxmox.com/git/pve-eslint
synced 2025-10-05 16:41:10 +00:00

includes a (minimal) working wrapper Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
19 lines
488 B
Markdown
19 lines
488 B
Markdown
# disallow deleting variables (no-delete-var)
|
|
|
|
The purpose of the `delete` operator is to remove a property from an object. Using the `delete` operator on a variable might lead to unexpected behavior.
|
|
|
|
## Rule Details
|
|
|
|
This rule disallows the use of the `delete` operator on variables.
|
|
|
|
If ESLint parses code in strict mode, the parser (instead of this rule) reports the error.
|
|
|
|
Examples of **incorrect** code for this rule:
|
|
|
|
```js
|
|
/*eslint no-delete-var: "error"*/
|
|
|
|
var x;
|
|
delete x;
|
|
```
|