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 names to skip. Supports a leading-* suffix (*.test.ts), an exact path, or a trailing path segment; ** globs are not supported. |
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. - Bracket access is not flagged — The rule only matches dot access (
Logger.dev(...)). Computed forms likeLogger['dev'](...)are intentionally ignored and will not be reported. - Only direct assignments are traced — A variable is flagged only when it is declared and initialized directly from
Logger.customize(...)(e.g.const log = Logger.customize(...)). Aliases of aliases, later re-assignments, function parameters, and destructured loggers are not tracked. - Want to keep the log? — Replace
Logger.devwithLogger.debug. Debug logs are gated byLOG_LEVELand stay silent in production by default.