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?
- Prevents dev-only log statements from leaking into production builds.
- Catches scoped loggers too, not just direct
Logger.dev()calls. - 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.
| Option | Type | Default | Description |
|---|---|---|---|
ignoreFiles | string[] | [] | 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 namedLoggeror variables traced back toLogger.customize(). Other objects with a.dev()method are ignored. - Want to keep the log? — Replace
Logger.devwithLogger.debug. Debug logs are gated byLOG_LEVELand stay silent in production by default.