# filename-case

Rule `unicorn/filename-case`. Enforce a case style for filenames and directory names.

- Source: unicorn
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 12M weekly downloads of presets that enable it
- Trend: +40.1% last quarter
- Rank: #762 by reach, #958 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/filename-case` | no | no | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/rules/filename-case.md) |
| Oxlint | `unicorn/filename-case` | no | no | plugin `unicorn`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/unicorn/filename-case.html) |
| Biome | `style/useFilenamingConvention` | no | no | group style, since 1.5.0 | [docs](https://biomejs.dev/linter/rules/use-filenaming-convention/) |

## Enable it

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

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

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

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "unicorn/filename-case": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "useFilenamingConvention": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Unicorn recommended](https://lintradar.dev/presets/unicorn-recommended.md) | ESLint | `eslint-plugin-unicorn` | 340 | 9.5M | +30.3% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [unicorn/consistent-existence-index-check](https://lintradar.dev/rules/unicorn/consistent-existence-index-check.md): Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
- [unicorn/no-negated-condition](https://lintradar.dev/rules/unicorn/no-negated-condition.md): Disallow negated conditions.
- [unicorn/require-number-to-fixed-digits-argument](https://lintradar.dev/rules/unicorn/require-number-to-fixed-digits-argument.md): Enforce using the digits argument with `Number#toFixed()`.
- [unicorn/no-negation-in-equality-check](https://lintradar.dev/rules/unicorn/no-negation-in-equality-check.md): Disallow negated expression in equality check.
- [unicorn/prefer-string-trim-start-end](https://lintradar.dev/rules/unicorn/prefer-string-trim-start-end.md): Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
- [unicorn/no-static-only-class](https://lintradar.dev/rules/unicorn/no-static-only-class.md): Disallow classes that only have static members.

---

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