# no-unexpected-multiline

Rule `eslint/no-unexpected-multiline`. Disallow confusing multiline expressions

- Source: eslint
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 197.7M weekly downloads of presets that enable it
- Trend: +25.2% last quarter
- Rank: #78 by reach, #1364 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-unexpected-multiline` | yes | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-unexpected-multiline) |
| Oxlint | `no-unexpected-multiline` | no | unsafe | plugin `eslint`, category suspicious | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unexpected-multiline.html) |

## Code examples

### Incorrect: the rule reports this

```js
const foo = bar
(1 || 2).baz();

const hello = 'world'
[1, 2, 3].forEach(addNumber);

const x = function() {}
`hello`

const y = function() {}
y
`hello`

const z = foo
/regex/g.test(bar)
```

### Correct: the rule accepts this

```js
const foo = bar;
(1 || 2).baz();

const baz = bar
;(1 || 2).baz()

const hello = 'world';
[1, 2, 3].forEach(addNumber);

const hi = 'world'
void [1, 2, 3].forEach(addNumber);

const x = function() {};
`hello`

const tag = function() {}
tag `hello`
```

Examples from the ESLint documentation.

## Enable it

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

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

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-unexpected-multiline": "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% |
| [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% |
| [JavaScript Standard Style](https://lintradar.dev/presets/standard.md) | ESLint | `eslint-config-standard` | 161 | 3.1M | +12.9% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [Nuxt](https://lintradar.dev/presets/nuxt.md) | ESLint | `@nuxt/eslint-config` | 188 | 1.5M | +72.8% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |
| [Google](https://lintradar.dev/presets/google.md) | ESLint | `eslint-config-google` | 60 | 646.4K | +18.9% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [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/no-empty](https://lintradar.dev/rules/eslint/no-empty.md): Disallow empty block statements
- [eslint/no-var](https://lintradar.dev/rules/eslint/no-var.md): Require `let` or `const` instead of `var`
- [eslint/no-undef](https://lintradar.dev/rules/eslint/no-undef.md): Disallow the use of undeclared variables unless mentioned in `/*global */` comments
- [eslint/prefer-spread](https://lintradar.dev/rules/eslint/prefer-spread.md): Require spread operators instead of `.apply()`
- [eslint/no-useless-assignment](https://lintradar.dev/rules/eslint/no-useless-assignment.md): Disallow variable assignments when the value is not used
- [eslint/prefer-rest-params](https://lintradar.dev/rules/eslint/prefer-rest-params.md): Require rest parameters instead of `arguments`

---

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