Inconsistent filename casing makes it harder to navigate a codebase and can cause problems on case-insensitive file systems. This rule enforces a single consistent case style across all linted files and requires file extensions to be lowercase.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sindresorhus/eslint-plugin-unicorn/llms.txt
Use this file to discover all available pages before exploring further.
| Recommended | ✅ recommended |
| Fixable | — |
| Suggestions | — |
index.js, index.mjs, index.cjs, index.ts, index.tsx, and index.vue are ignored by default. Characters other than a–z, A–Z, 0–9, -, and _ in the filename are also ignored.
The default case style is kebabCase.
Configuration options
You can use either thecase option (single style) or the cases option (allow multiple styles), but not both.
case
Type: stringAllowed values:
"camelCase", "kebabCase", "snakeCase", "pascalCase"
Enforce a single case style.
cases
Type: object
Allow multiple case styles simultaneously. Set each allowed style to true.
ignore
Type: Array<string | RegExp>Default:
[]
Filenames to skip. Strings are interpreted as regular expressions.
multipleFileExtensions
Type: booleanDefault:
true
When true (default), additional dot-separated segments like .test or .spec are treated as part of the file extension and are not subject to case enforcement.