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, and this page is available as Markdown at https://rslint.rs/rules/eslint/no-console.md.
close

no-console

Added in v0.2.2

Configuration

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:

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

Examples of correct code for this rule:

// 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