AI Code Smells

any types, console.log spam, TODOs, commented-out code piling up

infoAI Qualityai-smells

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.

Bad
export 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;
}
Good
interface 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.

All rules