# no-dynamic-delete

Rule `typescript/no-dynamic-delete`. Disallow using the `delete` operator on computed key expressions

- Source: typescript
- Technologies: TypeScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 48.2M weekly downloads of presets that enable it
- Trend: +32.9% last quarter
- Rank: #261 by reach, #1070 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/no-dynamic-delete` | no | no | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/no-dynamic-delete) |
| Oxlint | `typescript/no-dynamic-delete` | no | no | plugin `typescript`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-dynamic-delete.html) |
| Biome | `nursery/noDynamicDelete` | no | no | group nursery, since 2.6.5 | [docs](https://biomejs.dev/linter/rules/no-dynamic-delete/) |

## Code examples

### Incorrect: the rule reports this

```ts
// Dynamic, difficult-to-reason-about lookups
const name = 'name';
delete container[name];
delete container[name.toUpperCase()];
```

### Correct: the rule accepts this

```ts
const container: { [i: string]: number } = {/* ... */};

// Constant runtime lookups by string index
delete container.aaa;

// Constants that must be accessed by []
delete container[7];
delete container[-1];

// All strings are allowed, to be compatible with the noPropertyAccessFromIndexSignature
// TS compiler option
delete container['aaa'];
delete container['Infinity'];
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import tseslint from "typescript-eslint";

export default [
  {
    plugins: { "@typescript-eslint": tseslint.plugin },
    rules: {
      "@typescript-eslint/no-dynamic-delete": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "typescript/no-dynamic-delete": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noDynamicDelete": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [typescript-eslint strict](https://lintradar.dev/presets/typescript-eslint-strict.md) | ESLint | `@typescript-eslint/eslint-plugin` | 32 | 175.9M | +29.5% |
| [typescript-eslint strict type-checked](https://lintradar.dev/presets/typescript-eslint-strict-type-checked.md) | ESLint | `@typescript-eslint/eslint-plugin` | 75 | 175.9M | +29.5% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [Nuxt](https://lintradar.dev/presets/nuxt.md) | ESLint | `@nuxt/eslint-config` | 188 | 1.5M | +72.8% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [typescript/unified-signatures](https://lintradar.dev/rules/typescript/unified-signatures.md): Disallow two overloads that could be unified into one with a union or an optional/rest parameter
- [typescript/consistent-type-definitions](https://lintradar.dev/rules/typescript/consistent-type-definitions.md): Enforce type definitions to consistently use either `interface` or `type`
- [typescript/return-await](https://lintradar.dev/rules/typescript/return-await.md): Enforce consistent awaiting of returned promises
- [typescript/no-inferrable-types](https://lintradar.dev/rules/typescript/no-inferrable-types.md): Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean
- [typescript/prefer-for-of](https://lintradar.dev/rules/typescript/prefer-for-of.md): Enforce the use of `for-of` loop over the standard `for` loop where possible
- [typescript/no-non-null-asserted-nullish-coalescing](https://lintradar.dev/rules/typescript/no-non-null-asserted-nullish-coalescing.md): Disallow non-null assertions in the left operand of a nullish coalescing operator

---

Web page: https://lintradar.dev/rules/typescript/no-dynamic-delete. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
