-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable no-console eslint rule for project #4802
Conversation
@@ -81,7 +81,7 @@ describe('onetag', function () { | |||
} | |||
}); | |||
} catch (e) { | |||
console.log('Error while parsing'); | |||
console.log('onetagBidAdapter tests: Error while parsing'); // eslint-disable-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to keep these these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought at first they would be good to keep for the adapter's tests, but in retrospect they're not too helpful. I pushed an update to remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this idea, but I feel like this should apply to the whole codebase, not just the tests. It's almost more important that console.log
s don't end up in src
and modules
files than in the tests
.
Do you think it would be doable to enable this for the project and then add exceptions for the usages in utils.js
?
Hi @snapwich Expanding the scope does make sense, I'll try to make the necessary updates soon. |
I pushed in the requested updates. Please take another look when you get the chance. Thanks! |
Hey @snapwich @mkendall07 , can you please take another look and approve (if it looks good now)? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* 'master' of https://github.com/prebid/Prebid.js: (49 commits) Submitting Clicktripz bid adapter (prebid#4929) add UNICORN bid adapter (prebid#4917) 3.12.0-pre 3.11.0 release Eids liveintent ext fix (prebid#4944) add mediaforce bid adapter (prebid#4933) update logic in adpod module for playersize (prebid#4953) Module - Size Mapping V2 (prebid#4690) Lifestreet adapter 3.0 (prebid#4927) IX Adapter - Increase banner TTL to 300s (prebid#4957) assert string returned not that we break things (prebid#4962) added option to url parser to ignore decoding entire url (prebid#4938) adding user-id support in medianet adapter (prebid#4925) removing the log (prebid#4960) add import extensions (prebid#4959) Add 7xbid adapter to compatible with prebid 3.0 (prebid#4908) Fix failing code-coverage command (prebid#4892) enable no-console eslint rule for project (prebid#4802) update audigent tests to fix larger test suite issue (prebid#4952) use bidId or bidIds in the payload (prebid#4903) ...
* master: (49 commits) Submitting Clicktripz bid adapter (prebid#4929) add UNICORN bid adapter (prebid#4917) 3.12.0-pre 3.11.0 release Eids liveintent ext fix (prebid#4944) add mediaforce bid adapter (prebid#4933) update logic in adpod module for playersize (prebid#4953) Module - Size Mapping V2 (prebid#4690) Lifestreet adapter 3.0 (prebid#4927) IX Adapter - Increase banner TTL to 300s (prebid#4957) assert string returned not that we break things (prebid#4962) added option to url parser to ignore decoding entire url (prebid#4938) adding user-id support in medianet adapter (prebid#4925) removing the log (prebid#4960) add import extensions (prebid#4959) Add 7xbid adapter to compatible with prebid 3.0 (prebid#4908) Fix failing code-coverage command (prebid#4892) enable no-console eslint rule for project (prebid#4802) update audigent tests to fix larger test suite issue (prebid#4952) use bidId or bidIds in the payload (prebid#4903) ...
* add no-console eslint rule for tests directory * remove console logs from onetag tests * update scope of rule to include src files
Type of change
Description of change
There have been a number of PRs in the past where the unit tests included some rogue
console.log
statements and they were accidentally missed by the reviewers.While not a big deal, it does end up polluting the console messages when we run the tests (especially the browserstack tests, since they get displayed for each browser), and it becomes somewhat tedious to track them down later and create another PR just to remove them.
I made this PR to enable the no-console rule for the eslint rules in our
test
directory to hopefully help us better catch these instances during the review process.I also updated the various files in the
test
directory usingconsole.log
; either removing them or disabling the rule.Update
Per feedback, I have extended this lint logic to the project rather than just the tests directory.