Code is written once but read many times. Abbreviations likeDocumentation 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.
e, cb, err, req, and res save a few keystrokes but force every future reader to decode the shorthand. This rule flags discouraged abbreviations and suggests full-word replacements, with an auto-fix when there is exactly one possible replacement.
| Recommended | ✅ recommended |
| Fixable | 🔧 Auto-fix (single replacement only) |
| Suggestions | — |
Examples
Configuration
eslint.config.js
replacements
Type: object
Extend or override the default replacements. Each key is an abbreviation; the value is an object mapping replacement names to true (enabled) or false (disabled).
extendDefaultReplacements
Type: boolean — Default: true
When false, the replacements option completely replaces the built-in list instead of extending it.
allowList
Type: object
Map of exact identifier names (case-sensitive) to true to exempt them from reporting.
extendDefaultAllowList
Type: boolean — Default: true
When false, the allowList option completely replaces the built-in allow list.
checkDefaultAndNamespaceImports
Type: 'internal' | boolean — Default: 'internal'
'internal'— check default and namespace import names only for internal modules (relative or absolute paths, notnode_modules).true— check all default and namespace import names.false— skip default and namespace import names entirely.
checkShorthandImports
Type: 'internal' | boolean — Default: 'internal'
Same as checkDefaultAndNamespaceImports but for shorthand ({named}) imports.
checkShorthandProperties
Type: boolean — Default: false
When true, destructured shorthand property names are also checked.
checkProperties
Type: boolean — Default: false
When true, object property keys and class member names are checked.
checkVariables
Type: boolean — Default: true
Set to false to skip variable name checks entirely.
checkFilenames
Type: boolean — Default: true
Set to false to skip filename checks. When enabled, only the basename is tested (not the full path).
ignore
Type: Array<string | RegExp> — Default: []
Patterns to ignore. Strings are interpreted as regular expressions.
The auto-fix only applies when there is exactly one possible replacement. When multiple replacements exist, the rule reports all suggestions but leaves the rename to you.