# no-with

Rule `eslint/no-with`. Disallow `with` statements

- Source: eslint
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 279.7M weekly downloads of presets that enable it
- Trend: +44.9% last quarter
- Rank: #14 by reach, #920 by growth

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
with (point) {
    r = Math.sqrt(x * x + y * y); // is r a member of point?
}
```

### Correct: the rule accepts this

```js
const r = ({x, y}) => Math.sqrt(x * x + y * y);
```

Examples from the ESLint documentation.

## Enable it

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

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

### Oxlint: `.oxlintrc.json`

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

### Biome: `biome.json`

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

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [ESLint recommended](https://lintradar.dev/presets/eslint-recommended.md) | ESLint | `@eslint/js` | 64 | 178.8M | +25.9% |
| [Oxlint default](https://lintradar.dev/presets/oxlint-default.md) | Oxlint | `oxlint` | 111 | 50.8M | +183.6% |
| [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% |
| [Create React App](https://lintradar.dev/presets/react-app.md) | ESLint | `eslint-config-react-app` | 109 | 4.1M | +4.3% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [JavaScript Standard Style](https://lintradar.dev/presets/standard.md) | ESLint | `eslint-config-standard` | 161 | 3.1M | +12.9% |
| [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% |
| [Google](https://lintradar.dev/presets/google.md) | ESLint | `eslint-config-google` | 60 | 646.4K | +18.9% |
| [neostandard](https://lintradar.dev/presets/neostandard.md) | ESLint | `neostandard` | 95 | 317.6K | +50.2% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [eslint/valid-typeof](https://lintradar.dev/rules/eslint/valid-typeof.md): Enforce comparing `typeof` expressions against valid strings
- [eslint/no-const-assign](https://lintradar.dev/rules/eslint/no-const-assign.md): Disallow reassigning `const`, `using`, and `await using` variables
- [eslint/no-self-assign](https://lintradar.dev/rules/eslint/no-self-assign.md): Disallow assignments where both sides are exactly the same
- [eslint/no-dupe-keys](https://lintradar.dev/rules/eslint/no-dupe-keys.md): Disallow duplicate keys in object literals
- [eslint/no-empty-pattern](https://lintradar.dev/rules/eslint/no-empty-pattern.md): Disallow empty destructuring patterns
- [eslint/no-func-assign](https://lintradar.dev/rules/eslint/no-func-assign.md): Disallow reassigning `function` declarations

---

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