Skip to main content

No Logger.dev

Flag Logger.dev calls so dev-only logging statements get caught before they ship to production.

Summary

The no-logger-dev rule reports any call to .dev() on Logger, Logger.customize(), or variables assigned from Logger.customize().

Use Logger.debug instead if you want to keep the log.

Why Use This Rule?

  1. Prevents dev-only log statements from leaking into production builds.
  2. Catches scoped loggers too, not just direct Logger.dev() calls.
  3. Keeps the codebase clean by making dev logging intentionally noisy during linting.

Examples

Configuration

Options

warning

ignoreFiles is an escape hatch for files where this rule genuinely does not apply. It is not intended for routine use.

OptionTypeDefaultDescription
ignoreFilesstring[][]File patterns to skip.

Autofix

Autofix is not available for this rule. Flagged code must be updated manually.

Troubleshooting

  • Warning fires on a .dev() call that isn't Logger — The rule only flags calls on identifiers named Logger or variables traced back to Logger.customize(). Other objects with a .dev() method are ignored.
  • Want to keep the log? — Replace Logger.dev with Logger.debug. Debug logs are gated by LOG_LEVEL and stay silent in production by default.