Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.07 KB

File metadata and controls

50 lines (34 loc) · 1.07 KB

eslint/no-console

💡 A suggestion is available for this rule.

What it does

Disallows using the global console object.

Why is this bad?

In JavaScript that is designed to be executed in the browser, it’s considered a best practice to avoid using methods on console. Such messages are considered to be for debugging purposes and therefore not suitable to ship to the client.

Example

console.log("here");

How to use

To enable this rule in the CLI or using the config file, you can use:

::: code-group

oxlint --deny no-console
{
  "rules": {
    "no-console": "error"
  }
}

:::

References