no-empty-implementations
FreeDead CodeDisallow empty or stub function implementations left by AI assistants
no-empty-implementations
Disallow empty or stub function implementations left by AI assistants
Category: Dead Code | Tier: Free
Why This Matters
AI generates function signatures and class methods with empty bodies or stub comments. The code compiles and appears complete at a glance, but at runtime these hollow functions silently do nothing, causing subtle bugs.
Bad Code
// AI generated empty function bodies
function validateInput(data: unknown) {
// validation logic goes here
}
class AuthService {
async login(email: string, password: string) {}
}
Good Code
function validateInput(data: unknown) {
if (!data || typeof data !== 'object') {
throw new Error('Invalid input: expected an object');
}
}
Configuration
This rule has no configuration options. It is enabled by default in lintmyai:recommended.