AI Code Smells
TODO and FIXME comments, piles of console.log and any, commented-out code, "not implemented" stubs
infoAI Quality
ai-smellsSeverity depends on context. Info for TODO comments and commented-out code. Warning for more than 3 console.log calls or more than 5 any types in one file, and for "not implemented" stubs.
Why this matters
AI tools generate code with 'any' types for expediency, leave console.logs for debugging, and create TODOs it never resolves. These accumulate into unmaintainable code fast.
Example
lib/data.tsexport async function getData(input: any): any {
console.log("getData called", input);
// TODO: add error handling
// const oldLogic = input.map(x => x.id);
const result = await fetch(url);
console.log("result", result);
return result;
}lib/data.tsinterface DataInput {
ids: string[];
filter?: string;
}
export async function getData(input: DataInput): Promise<Response> {
const result = await fetch(url);
return result;
}How to fix
Replace 'any' with proper types. Remove console.logs before committing. Resolve or remove TODOs. Delete commented-out code — it's in git history if you need it.
Reference
- In the output
- Findings carry
"ruleId": "ai-smells"in--jsonand the same id in SARIF and in the terminal. - Silence one line
// prodlint-disable-next-line ai-smells- Silence a whole file
// prodlint-disable ai-smellsat the top of the file- How it works
- Matches text patterns. Source on GitHub