consoleCalls
Reports calls to console methods.
✅ This rule is included in the ts preset.
Console methods like console.log, console.warn, and console.error are useful during development but should typically be removed before shipping to production.
They can expose sensitive information to users and clutter the browser console.
Examples
Section titled “Examples”function processUser(user: User) { console.log("Processing user:", user); return user.name;}function processUser(user: User) { return user.name;}Options
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”If your project intentionally uses console methods for logging in production, such as in a Node.js server application, you might choose to disable this rule. You might also disable it if you have a build step that strips console calls from production builds.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- Biome:
noConsole - Deno:
no-console - ESLint:
no-console - Oxlint:
eslint/no-console
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.