Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

📎 noConsoleLog #4223

Closed
jpike88 opened this issue Feb 21, 2023 · 5 comments · Fixed by #4357
Closed

📎 noConsoleLog #4223

jpike88 opened this issue Feb 21, 2023 · 5 comments · Fixed by #4357
Labels
A-Linter Area: linter task A task, an action that needs to be performed

Comments

@jpike88
Copy link

jpike88 commented Feb 21, 2023

Description

https://eslint.org/docs/latest/rules/no-console

forces people to use .error, .info, but not .log as it's for debug purposes and not explicit about the context of the output.

Or maybe it's better to have a more general purpose 'ban', so users can configure more fine-grained things to ban including something like this.

@jpike88 jpike88 added the task A task, an action that needs to be performed label Feb 21, 2023
@Conaclos
Copy link
Contributor

By default, the rule seems to completely disallow any call to console. You suggest another default behavior?

@Conaclos Conaclos changed the title 📎 no console log rule 📎 noConsole log rule Feb 21, 2023
@jpike88
Copy link
Author

jpike88 commented Feb 22, 2023

Whoops! Sorry yes. Referring to my eslint file:

#3774

I configured it in such a way that basically everything was allowed BUT the use of console.log. This ensures developers don't accidentally leave hanging console.logs for debug purposes, anything that's not a log would be something deliberate and intended to remain in the code indefinitely.

@Conaclos Conaclos changed the title 📎 noConsole log rule 📎 noConsoleLog Feb 22, 2023
@Conaclos Conaclos added the A-Linter Area: linter label Feb 22, 2023
@christianalares
Copy link

Any news on this? I really enjoyed the no-console-rule in eslint, would be a great feature to have in rome

@ematipico
Copy link
Contributor

PRs welcome :)

@jpike88
Copy link
Author

jpike88 commented Apr 7, 2023

im open as well to a general noConsole rule if that's more in demand

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter task A task, an action that needs to be performed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants