no-fake-async
FreeAI BehaviorDisallow async functions that have no await expression
no-fake-async
Disallow async functions that have no await expression
Category: AI Behavior | Tier: Free
Why This Matters
AI marks functions as async even when they contain no await expressions. This forces the return value into a Promise unnecessarily, adding overhead and misleading callers about whether the operation involves I/O.
Bad Code
// AI marks functions async with no await
async function getUser(id: string) {
return users.find(u => u.id === id);
}
async function formatName(name: string) {
return name.trim().toLowerCase();
}
Good Code
// Remove async when no await is needed
function getUser(id: string) {
return users.find(u => u.id === id);
}
function formatName(name: string) {
return name.trim().toLowerCase();
}
Configuration
This rule has no configuration options. It is enabled by default in lintmyai:recommended.