Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

feat!: activate "no-console" rule #79

Merged
merged 1 commit into from
Aug 30, 2019
Merged

feat!: activate "no-console" rule #79

merged 1 commit into from
Aug 30, 2019

Conversation

wincent
Copy link
Contributor

@wincent wincent commented Aug 30, 2019

Tested in liferay-portal: currently catches 1 issue, so I don't think this will be very noisy.

Note that I tuned this to not complain about console.warn or console.error, which are generally used to report legitimate problems and are not expected to produce routine console spew (unlike console.log, which is often an overlooked piece of debug code that has been removed).

Needless to say, tools that actually need to print the console can trivially suppress this lint.

Closes: #74

Tested in liferay-portal: currently catches 1 issue, so I don't think
this will be very noisy.

Note that I tuned this to not complain about `console.warn` or
`console.error`, which are generally used to report legitimate
problems and are not expected to produce routine console spew (unlike
`console.log`, which is often an overlooked piece of debug code that has
been removed).

Closes: #74
@wincent
Copy link
Contributor Author

wincent commented Aug 30, 2019

Ignoring the Semantic Pull Request bot on this one because: zeke/semantic-pull-requests#51

@wincent wincent merged commit 77e2a2c into master Aug 30, 2019
@wincent wincent deleted the wincent/console branch August 30, 2019 12:49
brianchandotcom pushed a commit to brianchandotcom/liferay-portal that referenced this pull request Oct 30, 2019
As of liferay/eslint-config-liferay#79 we
activated the "no-console" rule, allowing use of "console.warn" and
"console.error" as exceptions. So, there are a few places in
liferay-portal where we have unnecessary suppressions (because they
relate to "warn" or "error" calls, or because they use "log" calls that
really should be "warn"/"error").

Additionally, as per the guidelines at:

https://github.com/liferay/liferay-frontend-guidelines/blob/c1f6e942ed19b8/dxp/debugging.md

...we try to minimize the use of logging outside of the development
environment, so there is at least one place where a log call should be
moved inside an appropriate guard check (the component already displays
an empty state with an "error occurred and unable to load" message in
theUI, so the logging is definitely redundant).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Activate no-console rule
1 participant