# no-console

Rule `eslint/no-console`. Disallow the use of `console`

- Source: eslint
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 10.1M weekly downloads of presets that enable it
- Trend: +2.6% last quarter
- Rank: #891 by reach, #1553 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-console` | no | suggestion | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-console) |
| Oxlint | `no-console` | no | suggestion | plugin `eslint`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-console.html) |
| Biome | `suspicious/noConsole` | no | unsafe | group suspicious, since 1.6.0 | [docs](https://biomejs.dev/linter/rules/no-console/) |

## Code examples

### Incorrect: the rule reports this

```js
console.log("Log a debug level message.");
console.warn("Log a warn level message.");
console.error("Log an error level message.");
console.log = foo();
```

### Correct: the rule accepts this

```js
// custom console
Console.log("Hello world!");
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "no-console": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-console": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "noConsole": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [vue/no-console](https://lintradar.dev/rules/vue/no-console.md): Disallow the use of `console` in `<template>`
- [eslint/no-shadow](https://lintradar.dev/rules/eslint/no-shadow.md): Disallow variable declarations from shadowing variables declared in the outer scope
- [eslint/no-empty-function](https://lintradar.dev/rules/eslint/no-empty-function.md): Disallow empty functions
- [eslint/no-nested-ternary](https://lintradar.dev/rules/eslint/no-nested-ternary.md): Disallow nested ternary expressions
- [eslint/max-classes-per-file](https://lintradar.dev/rules/eslint/max-classes-per-file.md): Enforce a maximum number of classes per file
- [eslint/default-param-last](https://lintradar.dev/rules/eslint/default-param-last.md): Enforce default parameters to be last

---

Web page: https://lintradar.dev/rules/eslint/no-console. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
