Skip to content

Commit

Permalink
chore: add imgs + improve no-console description
Browse files Browse the repository at this point in the history
  • Loading branch information
drecali committed Sep 4, 2022
1 parent 69aca2a commit de286df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eslint/no-console-1-disallow-all-console-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ module.exports = {
};
```

<img width="625" alt="image" src="https://user-images.githubusercontent.com/24983797/188299794-059153cd-1362-43b4-a8f6-705d479decaa.png">
<img width="928" alt="image" src="https://user-images.githubusercontent.com/24983797/188308213-243a3e6d-89a1-4ba2-ba7b-6196e49da89f.png">

But what if you need to output some information to the console and want to avoid triggering ESLint errors or warnings? Read [Part 2](./no-console-2-allow-some-console-methods.md) to find out.
6 changes: 5 additions & 1 deletion eslint/no-console-2-allow-some-console-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ In some cases, there may be a legitimate need for code to use `console` methods.
};
```

The console methods above format the output differently:
| Before | After |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| all `console` methods disallowed <img width="928" alt="image" src="https://user-images.githubusercontent.com/24983797/188308213-243a3e6d-89a1-4ba2-ba7b-6196e49da89f.png"> | only `console.log` disallowed <img width="928" alt="image" src="https://user-images.githubusercontent.com/24983797/188308112-9994e9af-8865-4f3d-83cb-75cf693f2c09.png"> |

The console different methods in code snippet above result in different output styles:

<img width="682" alt="image" src="https://user-images.githubusercontent.com/24983797/188304293-5fb33951-3eae-4120-9e60-280e0a07a660.png">

Expand Down

0 comments on commit de286df

Please sign in to comment.