# object-property-newline

Rule `eslint/object-property-newline`. Enforce placing object properties on separate lines

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `object-property-newline` | no | safe | package `eslint` | [docs](https://eslint.org/docs/latest/rules/object-property-newline) |

## Code examples

### Incorrect: the rule reports this

```js
const obj0 = { foo: "foo", bar: "bar", baz: "baz" };

const obj1 = {
    foo: "foo", bar: "bar", baz: "baz"
};

const obj2 = {
    foo: "foo", bar: "bar",
    baz: "baz"
};

const obj3 = {
    [process.argv[3] ? "foo" : "bar"]: 0, baz: [
        1,
        2,
        4,
        8
    ]
};

const a = "antidisestablishmentarianistically";
const b = "yugoslavyalılaştırabildiklerimizdenmişsiniz";
const obj4 = {a, b};

const domain = process.argv[4];
const obj5 = {
    foo: "foo", [
    domain.includes(":") ? "complexdomain" : "simpledomain"
]: true};
```

### Correct: the rule accepts this

```js
const obj1 = {
    foo: "foo",
    bar: "bar",
    baz: "baz"
};

const obj2 = {
    foo: "foo"
    , bar: "bar"
    , baz: "baz"
};

const user = process.argv[2];
const obj3 = {
    user,
    [process.argv[3] ? "foo" : "bar"]: 0,
    baz: [
        1,
        2,
        4,
        8
    ]
};
```

```js
const obj = { foo: "foo", bar: "bar", baz: "baz" };

const obj2 = {
    foo: "foo", bar: "bar", baz: "baz"
};
const user = process.argv[2];
const obj3 = {
    user, [process.argv[3] ? "foo" : "bar"]: 0, baz: [1, 2, 4, 8]
};
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "object-property-newline": "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% |

## Related rules

- [vue/object-property-newline](https://lintradar.dev/rules/vue/object-property-newline.md): Enforce placing object properties on separate lines in `<template>`
- [eslint/guard-for-in](https://lintradar.dev/rules/eslint/guard-for-in.md): Require `for-in` loops to include an `if` statement
- [eslint/no-bitwise](https://lintradar.dev/rules/eslint/no-bitwise.md): Disallow bitwise operators
- [eslint/vars-on-top](https://lintradar.dev/rules/eslint/vars-on-top.md): Require `var` declarations be placed at the top of their containing scope
- [eslint/grouped-accessor-pairs](https://lintradar.dev/rules/eslint/grouped-accessor-pairs.md): Require grouped accessor pairs in object literals and classes
- [eslint/prefer-object-spread](https://lintradar.dev/rules/eslint/prefer-object-spread.md): Disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead

---

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