# no-div-regex

Rule `eslint/no-div-regex`. Disallow equal signs explicitly at the beginning of regular expressions

- Source: eslint
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 3.3M weekly downloads of presets that enable it
- Trend: +66.0% last quarter
- Rank: #1459 by reach, #454 by growth

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
function bar() { return /=foo/; }
```

### Correct: the rule accepts this

```js
function bar() { return /[=]foo/; }
```

Examples from the ESLint documentation.

## Enable it

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

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

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-div-regex": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "complexity": {
        "noDivRegex": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [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% |

## Related rules

- [eslint/no-object-constructor](https://lintradar.dev/rules/eslint/no-object-constructor.md): Disallow calls to the `Object` constructor without an argument
- [eslint/max-nested-callbacks](https://lintradar.dev/rules/eslint/max-nested-callbacks.md): Enforce a maximum depth that callbacks can be nested
- [eslint/complexity](https://lintradar.dev/rules/eslint/complexity.md): Enforce a maximum cyclomatic complexity allowed in a program
- [eslint/require-unicode-regexp](https://lintradar.dev/rules/eslint/require-unicode-regexp.md): Enforce the use of `u` or `v` flag on regular expressions
- [eslint/prefer-object-has-own](https://lintradar.dev/rules/eslint/prefer-object-has-own.md): Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`
- [eslint/no-implicit-globals](https://lintradar.dev/rules/eslint/no-implicit-globals.md): Disallow declarations in the global scope

---

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