[meta] Enable ESLint rule no-console on production files
Categories
(Developer Infrastructure :: Lint and Formatting, task, P3)
Tracking
(Not tracked)
People
(Reporter: standard8, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: meta)
Related to improving our logging story (bug 881389), we want to enable the ESLint rule no-console
across our production code. The intent of this is to help ensure that we're not unnecessarily/unintentionally spamming the console, and that we're thinking about the correct log levels for messages.
Where components need specific logging, they can use console.createInstance
to define a custom logger which can have appropriate log levels set.
We will be allowing console.error
, console.warn
and console.createInstance
. The first two are considered acceptable for error situations, the last is needed for the above logging.
We might also expand this to tests which should generally use info
, however, if we can resolve some of the async issues with the output of console.*
vs info
then we could potentially keep allowing console use in tests.
Description
•