Skip to content

Commit

Permalink
Docs: Add spacing in comments for no-console rule (#12696)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkhn authored and kaicataldo committed Dec 20, 2019
1 parent 7171fca commit 6b774ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/rules/no-console.md
Expand Up @@ -14,7 +14,7 @@ This rule disallows calls to methods of the `console` object.
Examples of **incorrect** code for this rule:

```js
/*eslint no-console: "error"*/
/* eslint no-console: "error" */

console.log("Log a debug level message.");
console.warn("Log a warn level message.");
Expand All @@ -24,7 +24,7 @@ console.error("Log an error level message.");
Examples of **correct** code for this rule:

```js
/*eslint no-console: "error"*/
/* eslint no-console: "error" */

// custom console
Console.log("Hello world!");
Expand All @@ -39,7 +39,7 @@ This rule has an object option for exceptions:
Examples of additional **correct** code for this rule with a sample `{ "allow": ["warn", "error"] }` option:

```js
/*eslint no-console: ["error", { allow: ["warn", "error"] }] */
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */

console.warn("Log a warn level message.");
console.error("Log an error level message.");
Expand All @@ -52,7 +52,7 @@ If you're using Node.js, however, `console` is used to output information to the
Another case where you might not use this rule is if you want to enforce console calls and not console overwrites. For example:

```js
/*eslint no-console: ["error", { allow: ["warn"] }] */
/* eslint no-console: ["error", { allow: ["warn"] }] */
console.error = function (message) {
throw new Error(message);
};
Expand Down

0 comments on commit 6b774ef

Please sign in to comment.