> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# no-console

[Added in v0.2.2](https://github.com/web-infra-dev/rslint/releases/tag/v0.2.2)
## Configuration


```ts title=rslint.config.ts
import { defineConfig, js } from '@rslint/core';

export default defineConfig([
  js.configs.recommended,
  {
    rules: {
      'no-console': 'error',
    },
  },
]);
```

## Rule Details

Disallow the use of `console`. In environments where `console` is not intended (such as production code), using `console` may be considered a debugging leftover.

Examples of **incorrect** code for this rule:

```javascript
console.log('message');
console.warn('warning');
console.error('error');
```

Examples of **correct** code for this rule:

```javascript
// With option { "allow": ["warn", "error"] }
console.warn('warning');
console.error('error');
```

## Options

- `allow`: An array of console method names that are allowed (e.g., `["warn", "error"]`).

## Original Documentation

- [ESLint: no-console](https://eslint.org/docs/latest/rules/no-console)
- [Source code](https://github.com/eslint/eslint/blob/v10.8.1/lib/rules/no-console.js)
