Codebase Consistency
Conflicting conventions across files: export naming, import style, HTTP client, async style, quotes
infoAI Quality
codebase-consistencySeverity depends on context. Warning when fewer than 60% of files agree.
Why this matters
Different AI sessions use different conventions. One file exports snake_case names, the next camelCase; one uses fetch, another axios; one awaits, another chains .then(). The codebase stops reading like one project.
Example
// lib/format_date.ts
export function format_date(date_str: string) { ... }
// lib/formatCurrency.ts
export const formatCurrency = (amount: number) => { ... }
// lib/parse_input.ts
export function parse_input(raw: string) { ... }// lib/format-date.ts
export function formatDate(dateStr: string) { ... }
// lib/format-currency.ts
export const formatCurrency = (amount: number) => { ... }
// lib/parse-input.ts
export function parseInput(raw: string) { ... }How to fix
Pick one convention for exported names, for imports (ESM or CommonJS), for the HTTP client and for async code, and apply it across the project. prodlint reports a dimension when fewer than 90% of files agree.
Reference
- In the output
- Findings carry
"ruleId": "codebase-consistency"in--jsonand the same id in SARIF and in the terminal. - Silence one line
// prodlint-disable-next-line codebase-consistency- Silence a whole file
// prodlint-disable codebase-consistencyat the top of the file- How it works
- Matches text patterns. Source on GitHub