# dot-location

Rule `eslint/dot-location`. Enforce consistent newlines before and after dots

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
var foo = object
.property;
```

```js
var foo = object.
property;
```

### Correct: the rule accepts this

```js
var foo = object.
property;

var bar = (
    object
).
property;

var baz = object.property;
```

```js
var foo = object
.property;
var bar = object.property;
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "dot-location": "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% |
| [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% |

## Related rules

- [vue/dot-location](https://lintradar.dev/rules/vue/dot-location.md): Enforce consistent newlines before and after dots in `<template>`
- [eslint/no-restricted-globals](https://lintradar.dev/rules/eslint/no-restricted-globals.md): Disallow specified global variables
- [eslint/no-void](https://lintradar.dev/rules/eslint/no-void.md): Disallow `void` operators
- [eslint/no-return-assign](https://lintradar.dev/rules/eslint/no-return-assign.md): Disallow assignment operators in `return` statements
- [eslint/one-var](https://lintradar.dev/rules/eslint/one-var.md): Enforce variables to be declared either together or separately in functions
- [eslint/prefer-promise-reject-errors](https://lintradar.dev/rules/eslint/prefer-promise-reject-errors.md): Require using Error objects as Promise rejection reasons

---

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