Closed Bug 1883371 Opened 1 month ago Closed 1 month ago

Enable ESLint rule no-console on production code

Categories

(Developer Infrastructure :: Lint and Formatting, task, P3)

Tracking

(firefox125 fixed)

RESOLVED FIXED
Tracking Status
firefox125 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

As discussed in bug 1881519, we want to enable ESLint rule no-console across our production code, to help ensure that we're not unnecessarily/unintentionally spamming the console, and that we're thinking about the correct log levels for messages.

We are allowing console.error, console.warn and console.createInstance. Everything else will be disallowed eventually. For now, we'll turn the rule off for existing failures and enable those over time.

This gives us the option to specify rule variations for all tests without having to copy across the configurations.

More importantly, we can also apply this to anything under /test/ or /tests/ and so we can catch utils and other files that the specific test configurations don't already catch.

Allow for console.error, console.warn and console.createInstance, but fail for everything else.

Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d78ef7334788
Add a general configuration for rules specific for all tests. r=mossop
https://hg.mozilla.org/integration/autoland/rev/013efc5f9131
Enable ESLint rule no-console on production code. r=mossop,webcompat-reviewers,devtools-reviewers,omc-reviewers,twisniewski,nchevobbe,aminomancer
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
See Also: → 1883846
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: