# prefer-exponentiation-operator

Rule `eslint/prefer-exponentiation-operator`. Disallow the use of `Math.pow` in favor of the `**` operator

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `prefer-exponentiation-operator` | no | safe | package `eslint` | [docs](https://eslint.org/docs/latest/rules/prefer-exponentiation-operator) |
| Oxlint | `prefer-exponentiation-operator` | no | safe | plugin `eslint`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/prefer-exponentiation-operator.html) |
| Biome | `style/useExponentiationOperator` | yes | safe | group style, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/use-exponentiation-operator/) |

## Code examples

### Incorrect: the rule reports this

```js
const foo = Math.pow(2, 8);

const bar = Math.pow(a, b);

let baz = Math.pow(a + b, c + d);

let quux = Math.pow(-1, n);
```

### Correct: the rule accepts this

```js
const foo = 2 ** 8;

const bar = a ** b;

let baz = (a + b) ** (c + d);

let quux = (-1) ** n;
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "prefer-exponentiation-operator": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "prefer-exponentiation-operator": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "useExponentiationOperator": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [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% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |
| [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/radix](https://lintradar.dev/rules/eslint/radix.md): Enforce the use of the radix argument when using `parseInt()`
- [eslint/prefer-template](https://lintradar.dev/rules/eslint/prefer-template.md): Require template literals instead of string concatenation
- [eslint/no-constructor-return](https://lintradar.dev/rules/eslint/no-constructor-return.md): Disallow returning value from constructor
- [eslint/prefer-numeric-literals](https://lintradar.dev/rules/eslint/prefer-numeric-literals.md): Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals
- [eslint/no-inner-declarations](https://lintradar.dev/rules/eslint/no-inner-declarations.md): Disallow variable or `function` declarations in nested blocks
- [eslint/no-useless-call](https://lintradar.dev/rules/eslint/no-useless-call.md): Disallow unnecessary calls to `.call()` and `.apply()`

---

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