---
url: /docs/guide/usage/linter/rules/eslint/id-denylist.md
---

### What it does

Disallow specified identifiers

### Why is this bad?

Generic names can lead to hard-to-decipher code. This rule allows you to specify a deny list of disallowed identifier names to avoid this practice.

### Examples

Examples of **incorrect** code for this rule:

```js
/*eslint id-denylist: ["error", "data", "callback"] */

const data = { ...values };
function callback() {
  // ...
}
element.callback = function () {
  // ...
};
const itemSet = {
  data: [...values],
};
class Foo {
  data = [];
}
class Bar {
  #data = [];
}
class Baz {
  callback() {}
}
class Qux {
  #callback() {}
}
```

Examples of **correct** code for this rule:

```js
/*eslint id-denylist: ["error", "data", "callback"] */

const encodingOptions = { ...values };
function processFileResult() {
  // ...
}
element.successHandler = function () {
  // ...
};
const itemSet = {
  entities: [...values],
};
callback(); // all function calls are ignored
foo.callback(); // all function calls are ignored
foo.data; // all property names that are not assignments are ignored
class Foo {
  items = [];
}
class Bar {
  #items = [];
}
class Baz {
  method() {}
}
class Qux {
  #method() {}
}
```

## Configuration

type: `array`

default: `[]`

## How to use

## Version

This rule was added in v1.76.0.

## References
