Mixed naming conventions — camelCase functions next to snake_case utilities, PascalCase components alongside kebab-case file names — slow down code review, create false matches during search, and generate typo-based import errors that TypeScript only catches if the module resolution fails. ISO 25010 maintainability.analysability degrades because developers cannot predict where code lives or what it's called. AI-generated projects are especially prone to this: convention drift accumulates across sessions as the model applies whatever convention seems locally natural.
Medium because naming inconsistencies slow every code review and search task, but they do not break runtime behavior unless they cause import resolution failures.
Codify the convention in ESLint so violations are flagged automatically:
"@typescript-eslint/naming-convention": ["warn",
{ "selector": "variable", "format": ["camelCase", "UPPER_CASE"] },
{ "selector": "function", "format": ["camelCase"] },
{ "selector": "typeLike", "format": ["PascalCase"] }
]
Run eslint --fix across the codebase to catch and flag existing violations. For file names, use a consistent casing convention and enforce it in CI with a filename linter.
ID: code-maintainability.naming-conventions.consistent-naming
Severity: medium
What to look for: Examine variable, function, component, and file naming across 10-15 source files. Check for consistency in:
getUserData, not get_user_data or GetUserData)UserCard, not userCard or user-card)UserCard.tsx, not userCard.tsx or user-card.tsx)MAX_RETRY_COUNT) or camelCase — whichever is used, it should be consistentLook for mixed conventions: some files use camelCase for components, others use PascalCase; some functions use camelCase, others use snake_case. AI-generated code is prone to convention drift between sessions.
Pass criteria: Enumerate all naming patterns found across at least 10 source files. The project consistently follows language conventions for naming (camelCase for variables/functions, PascalCase for classes/components) with no more than 2 deviations found across the files examined. Report the count: "Examined X files, found Y naming convention deviations."
Fail criteria: 3 or more naming convention violations found, or two fundamentally different conventions are used for the same category of identifiers (e.g., some functions are camelCase, others are snake_case).
Skip (N/A) when: The project has fewer than 3 source files to examine. Signal: fewer than 3 source files.
Detail on fail: "Mixed naming found: 4 component files use PascalCase (UserCard.tsx) but 3 use kebab-case (user-profile.tsx). 2 utility functions use snake_case (get_user_by_id) while surrounding code uses camelCase."
Remediation: Inconsistent naming signals a project assembled in multiple AI sessions without a coherent convention. It slows code review, increases typos in imports, and creates false matches when searching.
Pick a convention and codify it in ESLint:
// .eslintrc.json
{
"rules": {
"camelcase": "warn",
"@typescript-eslint/naming-convention": ["warn",
{ "selector": "variable", "format": ["camelCase", "UPPER_CASE"] },
{ "selector": "function", "format": ["camelCase"] },
{ "selector": "typeLike", "format": ["PascalCase"] }
]
}
}
Then run ESLint with --fix across the codebase to catch and flag violations automatically.