lowhygiene
Console Logs in Production
Finds console.log statements that should be removed before production.
Why This Is Bad
It looks unprofessional if a user opens their browser inspector and sees your debugging messages. It can also leak sensitive information.
How To Fix
Remove console.log statements or replace with a proper logger:
typescript
// Option 1: Remove entirely
// console.log("debugging stuff"); // DELETE THIS
// Option 2: Use environment-aware logging
if (process.env.NODE_ENV === 'development') {
console.log('Debug info');
}
// Option 3: Use a proper logger (recommended)
// npm install pino
import pino from 'pino';
const logger = pino({ level: process.env.LOG_LEVEL || 'info' });
logger.info('This is properly logged');When You Pass This Check
Your production logs are squeaky clean. Professional code!
Check If Your Repo Has This Issue
Our free scanner will detect this and 17 other common issues in your codebase.