# dot-notation

Rule `eslint/dot-notation`. Enforce dot notation whenever possible

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `dot-notation` | no | safe | package `eslint` | [docs](https://eslint.org/docs/latest/rules/dot-notation) |
| Biome | `complexity/useLiteralKeys` | yes | unsafe | group complexity, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/use-literal-keys/) |

## Code examples

### Incorrect: the rule reports this

```js
const x = foo["bar"];
```

### Correct: the rule accepts this

```js
const x = foo.bar;

const y = foo[bar];    // Property name is a variable, square-bracket notation required
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "dot-notation": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "complexity": {
        "useLiteralKeys": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [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% |
| [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% |
| [React Native](https://lintradar.dev/presets/react-native.md) | ESLint | `@react-native/eslint-config` | 79 | 1.2M | +5.8% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |

## Related rules

- [typescript/dot-notation](https://lintradar.dev/rules/typescript/dot-notation.md): Enforce dot notation whenever possible
- [vue/dot-notation](https://lintradar.dev/rules/vue/dot-notation.md): Enforce dot notation whenever possible in `<template>`
- [eslint/new-cap](https://lintradar.dev/rules/eslint/new-cap.md): Require constructor names to begin with a capital letter
- [eslint/no-array-constructor](https://lintradar.dev/rules/eslint/no-array-constructor.md): Disallow `Array` constructors
- [eslint/default-case-last](https://lintradar.dev/rules/eslint/default-case-last.md): Enforce `default` clauses in `switch` statements to be last
- [eslint/no-label-var](https://lintradar.dev/rules/eslint/no-label-var.md): Disallow labels that share a name with a variable

---

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