> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# stray-console

> A console call in production code bypasses the logger, so its output has no level or structure.

## What it flags

A `console.*` call in server or Node code, as the execution context classifies it, writes unleveled, unstructured output. Browser and frontend files, CLI scripts (a shebang or `process.argv`), vendored or bundled libraries, stories, playgrounds, docs, examples and fixtures, calls under an eslint-disable comment for `no-console`, and a call directly followed by `process.exit` or `throw` are skipped, as are tests, configuration, seeds, migrations, logger implementations, development-only guards, last-resort `uncaughtException` handlers and error boundaries. When the file already has a `logger` (or a Nest `this.logger`), the fix routes the call through it and is marked for review.

An unexported Node entry invoked directly by a package build, copy or backup script can print operator progress. A build-only Vite plugin can print from its build hooks. A private helper qualifies when every reference calls it directly from one of those contexts.

A line comment such as `// oxlint-disable-next-line no-console` exempts console calls on the immediately following line.

## Configuration

`allowedMethods` lists the console methods your project uses intentionally. It defaults to an empty list. Supported names are `log`, `info`, `debug`, `warn`, `error`, `trace`, `dir` and `table`. A matching file override can replace the list. For example, this configuration permits `console.error` and keeps `console.log` reportable.

```json theme={null}
{
  "rules": { "stray-console": { "level": "warn", "options": { "allowedMethods": ["error"] } } }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.