---
title: "key-style"
description: "A key that does not match a naming rule (options: case, pattern)."
canonical_url: "https://x18n.dev/checks/key-style"
---
# key-style

> A key that does not match a naming rule (options: case, pattern).

<!-- Generated by docs/scripts/generate.ts from the source code. Do not edit. -->

A key that does not match a naming rule (options: case, pattern).

The check is off by default.

The check takes options. Set them with the array form:

```ts [x18n.config.ts]
import { defineConfig } from '@x18n/core'

export default defineConfig({
  checks: {
    'key-style': [
      'warning',
      { case: 'camel' }
    ],
  },
})
```

- `case`: `camel`, `snake`, `kebab` or `pascal`. Each segment of the key path must match.
- `pattern`: a regular expression that the whole key must match.

## Configure

Turn the check on in `checks`:

```ts [x18n.config.ts]
import { defineConfig } from '@x18n/core'

export default defineConfig({
  checks: {
    'key-style': 'warning',
  },
})
```

`x18n check --only key-style` runs this check alone. `x18n check --skip key-style` skips it for one run.

## Source

- [`packages/builtins/src/checks/index.ts`](https://github.com/x18n-dev/x18n/blob/main/packages/builtins/src/checks/index.ts)


## Sitemap

See the full [sitemap](https://x18n.dev/sitemap.md) for all pages.
