-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Disallow console log in ESLint #2307
Comments
Seems reasonable to me.
If there is, we can allow console.log on a per file/line basis. |
I would like to work on this! Just so we're clear: you want ANY call to console removed and forbidden, right? |
I agree that we can whitelist |
Okay but have a look at App.tsx:24. If I remove the console.log there, I could as well remove the catch block. Are exceptions caught on a higher level? Or how would you handle this specific case? Please bear with me, this would be my first contribution and I want to be extra cautious. |
@tobireuen, i don't think exceptions are handled on the higher level, a good way to handle that is by either informing the user with an alert or a notification with whatever error that is, or use some kind of a logger for now you can override no-console rule for that line, unless specified otherwise by the maintainers |
@Fibii thank you, will do it as you suggested and override the rule If someone would be so kind and assign this issue to me, I could open a pull request. 🙃 |
@tobireuen done! thanks for your contribution! |
…no-console added added eslint rule no-console to throw errors whenever calls to the console object are made and subsequently removed all calls OR allowed them on file level for specific cases fix HospitalRun#2307
🐛 Bug Report
As a followup to #2286 I thought it might be desirable to not allow any log messages in the application using an ESlint rule https://eslint.org/docs/rules/no-console
Proposed changes
console
call from the applicationconsole
call in the applicationIs there any good reason why
console
logs should be kept in the application?The text was updated successfully, but these errors were encountered: