# no-alert

Rule `eslint/no-alert`. Disallow the use of `alert`, `confirm`, and `prompt`

- Source: eslint
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Reach: 13.8M weekly downloads of presets that enable it
- Trend: +12.6% last quarter
- Rank: #684 by reach, #1449 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-alert` | no | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-alert) |
| Oxlint | `no-alert` | no | no | plugin `eslint`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-alert.html) |
| Biome | `suspicious/noAlert` | no | no | group suspicious, since 2.1.0 | [docs](https://biomejs.dev/linter/rules/no-alert/) |

## Code examples

### Incorrect: the rule reports this

```js
alert("here!");

confirm("Are you sure?");

prompt("What's your name?", "John Doe");
```

### Correct: the rule accepts this

```js
customAlert("Something happened!");

customConfirm("Are you sure?");

customPrompt("Who are you?");

function foo() {
    const alert = myCustomLib.customAlert;
    alert();
}
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "no-alert": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-alert": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "noAlert": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [React Native](https://lintradar.dev/presets/react-native.md) | ESLint | `@react-native/eslint-config` | 79 | 1.2M | +5.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

- [eslint/no-restricted-syntax](https://lintradar.dev/rules/eslint/no-restricted-syntax.md): Disallow specified syntax
- [eslint/camelcase](https://lintradar.dev/rules/eslint/camelcase.md): Enforce camelcase naming convention
- [eslint/block-scoped-var](https://lintradar.dev/rules/eslint/block-scoped-var.md): Enforce the use of variables within the scope they are defined
- [eslint/no-restricted-properties](https://lintradar.dev/rules/eslint/no-restricted-properties.md): Disallow certain properties on certain objects
- [eslint/strict](https://lintradar.dev/rules/eslint/strict.md): Require or disallow strict mode directives
- [eslint/no-loop-func](https://lintradar.dev/rules/eslint/no-loop-func.md): Disallow function declarations that contain unsafe references inside loop statements

---

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