I have just triggered landing for the ESLint rule no-console <https://eslint.org/docs/latest/rules/no-console> on our production code.

As the name suggests, this disallows the use of `console.*` in JavaScript code and will reject uses. However, for our production code, we will allow:

 * console.error
 * console.warn
 * console.createInstance

We are enabling this so that we are more intentional in our logging, and in reducing unnecessary console logging. This should also help to reduce accidental cases of committing redundant console.log statements.

The error and warn functions can still be used for appropriate exception situations.

For general debug logging that should be landed in the tree, please use a console instance created by console.createInstance <https://firefox-source-docs.mozilla.org/toolkit/javascript-logging.html#logging-using-the-console-web-api>, with an appropriate default level of logging.


We have currently disabled the rule on files that are using the disallowed functions. We will address them <https://bugzilla.mozilla.org/show_bug.cgi?id=1881519> over time.

For test code <https://bugzilla.mozilla.org/show_bug.cgi?id=1883707> we have not made a decision yet - there are some inconsistencies in test logging between info() and console.* that we'd like to look.

Mark.

--
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/c889c014-2d44-4b98-aabd-70293260d59e%40mozilla.com.

Reply via email to