# camelcase

Rule `eslint/camelcase`. Enforce camelcase naming convention

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `camelcase` | no | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/camelcase) |
| Biome | `style/useNamingConvention` | no | safe | group style, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/use-naming-convention/) |

## Code examples

### Incorrect: the rule reports this

```js
const { category_id } = query;

const { category_name = 1 } = query;

const { category_id: category_title } = query;

const { category_id: category_alias } = query;

const { category_id: categoryId, ...other_props } = query;
```

```js
const { category_id: category_alias } = query;

const { category_id, ...other_props } = query;
```

```js
const { some_property } = obj; // allowed by {ignoreDestructuring: true}
const foo = some_property + 1; // error, ignoreDestructuring does not apply to this statement
```

### Correct: the rule accepts this

```js
import { no_camelcased as camelCased } from "external-module";

const myFavoriteColor   = "#112C85";
const _myFavoriteColor  = "#112C85";
const myFavoriteColor_  = "#112C85";
const MY_FAVORITE_COLOR = "#112C85";
const foo1 = bar.baz_boom;
const foo2 = { qux: bar.baz_boom };

obj.do_something();
do_something();
new do_something();

const { category_id: category } = query;

function foo({ isCamelCased }) {
    // ...
};

function bar({ isCamelCased: isAlsoCamelCased }) {
    // ...
}

function baz({ isCamelCased = 'default value' }) {
    // ...
};

const { categoryId = 1 } = query;

const { foo: isCamelCased } = bar;

const { foo: camelCasedName = 1 } = quz;
```

```js
const obj = {
    my_pref: 1
};

obj.foo_bar = "baz";
```

```js
const { category_id } = query;

const { category_name = 1 } = query;

const { category_id_name: category_id_name } = query;
```

Examples from the ESLint documentation.

## Enable it

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

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

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "useNamingConvention": "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% |
| [Google](https://lintradar.dev/presets/google.md) | ESLint | `eslint-config-google` | 60 | 646.4K | +18.9% |
| [neostandard](https://lintradar.dev/presets/neostandard.md) | ESLint | `neostandard` | 95 | 317.6K | +50.2% |

## Related rules

- [vue/camelcase](https://lintradar.dev/rules/vue/camelcase.md): Enforce camelcase naming convention in `<template>`
- [eslint/no-restricted-syntax](https://lintradar.dev/rules/eslint/no-restricted-syntax.md): Disallow specified syntax
- [eslint/no-alert](https://lintradar.dev/rules/eslint/no-alert.md): Disallow the use of `alert`, `confirm`, and `prompt`
- [eslint/block-scoped-var](https://lintradar.dev/rules/eslint/block-scoped-var.md): Enforce the use of variables within the scope they are defined
- [eslint/no-restricted-properties](https://lintradar.dev/rules/eslint/no-restricted-properties.md): Disallow certain properties on certain objects
- [eslint/strict](https://lintradar.dev/rules/eslint/strict.md): Require or disallow strict mode directives

---

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