# curly

Rule `eslint/curly`. Enforce consistent brace style for all control statements

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
if (foo) foo++;

while (bar)
    baz();

if (foo) {
    baz();
} else qux();
```

```js
if (foo) {
    foo++;
}

if (foo) bar();
else {
    foo++;
}

while (true) {
    doSomething();
}

for (let i=0; i < items.length; i++) {
    doSomething();
}
```

```js
if (foo)
  doSomething();
else
  doSomethingElse();

if (foo) foo(
  bar,
  baz);
```

### Correct: the rule accepts this

```js
if (foo) {
    foo++;
}

while (bar) {
    baz();
}

if (foo) {
    baz();
} else {
    qux();
}
```

```js
if (foo) foo++;

else foo();

while (true) {
    doSomething();
    doSomethingElse();
}
```

```js
if (foo) foo++; else doSomething();

if (foo) foo++;
else if (bar) baz()
else doSomething();

do something();
while (foo);

while (foo
  && bar) baz();

if (foo) {
    foo++;
}

if (foo) { foo++; }

while (true) {
    doSomething();
    doSomethingElse();
}
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "curly": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "curly": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "useBlockStatements": "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% |
| [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% |
| [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-useless-concat](https://lintradar.dev/rules/eslint/no-useless-concat.md): Disallow unnecessary concatenation of literals or template literals
- [eslint/no-loop-func](https://lintradar.dev/rules/eslint/no-loop-func.md): Disallow function declarations that contain unsafe references inside loop statements
- [eslint/strict](https://lintradar.dev/rules/eslint/strict.md): Require or disallow strict mode directives
- [eslint/no-restricted-properties](https://lintradar.dev/rules/eslint/no-restricted-properties.md): Disallow certain properties on certain objects
- [eslint/camelcase](https://lintradar.dev/rules/eslint/camelcase.md): Enforce camelcase naming convention
- [eslint/no-restricted-syntax](https://lintradar.dev/rules/eslint/no-restricted-syntax.md): Disallow specified syntax

---

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