Closed seangates closed 6 years ago
A lot of folks also write tools & scripts in Node.js. console
is a requirement there. How do we handle those?
Since those are the exception, they should do a project-level override in the .eslintrc
for that project. Otherwise, we discourage it for code that shouldn't be using console
.
@mikewoo200 @mwoo @yomed What do you think?
I am for this suggestion, especially after seeing many forgotten console.log on the browser side in recent code reviews.
If the app is organized as Node-side main folder vs. client-side main folder, using per-directory .eslintrc would take care of allowing some/all console functions for Node-side only.
https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
Agree. It's better that bad console.log
's are suppressed, rather than the complete freedom to put them in. We should be limiting exposure at the same time providing the documentation to override if necessary.
Shall I make a PR?
Closed with #7
Description Update the setting for
no-console
to the following:Reasoning There are very few reasons we should be doing a straight
console.log
in production. Warn and error are much less of a problem. Otherwise, this should enforce it for most cases.Reference: https://eslint.org/docs/rules/no-console