# id-match

Rule `unicorn/id-match`. Require identifiers to match a specified regular expression.

- Source: unicorn
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2004 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/id-match` | no | no | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/rules/id-match.md) |

## Code examples

### Incorrect: the rule reports this

```js
const foo$ = 1;
```

### Correct: the rule accepts this

```js
const foo = 1;
```

Examples from the ESLint documentation.

## Enable it

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

```js
import unicorn from "eslint-plugin-unicorn";

export default [
  {
    plugins: { unicorn },
    rules: {
      "unicorn/id-match": "error",
    },
  },
];
```

## Related rules

- [eslint/id-match](https://lintradar.dev/rules/eslint/id-match.md): Require identifiers to match a specified regular expression
- [unicorn/consistent-function-style](https://lintradar.dev/rules/unicorn/consistent-function-style.md): Enforce function syntax by role.
- [unicorn/indent](https://lintradar.dev/rules/unicorn/indent.md): Enforce consistent indentation in JSON and CSS.
- [unicorn/consistent-destructuring](https://lintradar.dev/rules/unicorn/consistent-destructuring.md): Use destructured variables over properties.
- [unicorn/iteration-fallback-style](https://lintradar.dev/rules/unicorn/iteration-fallback-style.md): Enforce a consistent style for optional loop sources.
- [unicorn/consistent-arrow-return-style](https://lintradar.dev/rules/unicorn/consistent-arrow-return-style.md): Enforce a consistent return style for multiline arrow function bodies.

---

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