-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify allowed console methods in no-console rule #4412
Comments
Thanks for the issue! If you're reporting a bug, please be sure to include:
Requesting a new rule? Please see Proposing a New Rule for instructions. |
Duplicate of #2621 This has been brought up before, and since the rule is called |
Being outside the scope of the rule is a fair assessment, though I still think there's a place for more fine-grained control over console given that some of its methods are typically used for debugging, others for routine logging. The custom rule you linked to looks like it'll do the job though; thanks for pointing it out. (also, apologies for the duplicate issue, I searched through past ones but missed #2621) |
+1 |
2 similar comments
+1 |
+1 |
In some codebases I use
console.info
for permanent messages andconsole.log
for occasional debugging. It would be helpful if ESLint's no-console rule could be configured to warn about instances ofconsole.log
(which shouldn't be committed) while ignoringconsole.info
.Something like this:
I'm unsure how many developers differentiate between console methods in this manner, but I suspect I'm not the only one. If this rule option is deemed a good candidate, I'd be happy to work on it.
The text was updated successfully, but these errors were encountered: