Skip to content

Linting: enforce no useless escape #13618

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

Merged
merged 9 commits into from
Jul 29, 2025
Merged

Linting: enforce no useless escape #13618

merged 9 commits into from
Jul 29, 2025

Conversation

patmmccann
Copy link
Collaborator

working on #1111

Copy link

Whoa there, partner! 🌵🤠 We wrangled some duplicated code in your PR:

Reducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Please move the common code from both files into a library and import it in each. We hate that we have to mention this, however, commits designed to hide from this utility by renaming variables or reordering an object are poor conduct. We will not look upon them kindly! Keep up the great work! 🚀

Copy link

Whoa there, partner! 🌵🤠 We wrangled some duplicated code in your PR:

Reducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Please move the common code from both files into a library and import it in each. We hate that we have to mention this, however, commits designed to hide from this utility by renaming variables or reordering an object are poor conduct. We will not look upon them kindly! Keep up the great work! 🚀

@coveralls
Copy link
Collaborator

coveralls commented Jul 16, 2025

Pull Request Test Coverage Report for Build 16603030716

Details

  • 14 of 15 (93.33%) changed or added relevant lines in 11 files are covered.
  • 8 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.001%) to 96.263%

Changes Missing Coverage Covered Lines Changed/Added Lines %
modules/outbrainBidAdapter.js 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
modules/adxpremiumAnalyticsAdapter.js 1 83.19%
modules/bliinkBidAdapter.js 1 96.49%
modules/eskimiBidAdapter.js 1 75.86%
modules/lotamePanoramaIdSystem.js 1 89.71%
modules/mediakeysBidAdapter.js 1 94.7%
test/spec/modules/lotamePanoramaIdSystem_spec.js 1 99.62%
libraries/smartyadsUtils/getAdUrlByRegion.js 2 64.29%
Totals Coverage Status
Change from base Build 16602520873: 0.001%
Covered Lines: 195054
Relevant Lines: 202627

💛 - Coveralls

Copy link

Whoa there, partner! 🌵🤠 We wrangled some duplicated code in your PR:

Reducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Please move the common code from both files into a library and import it in each. We hate that we have to mention this, however, commits designed to hide from this utility by renaming variables or reordering an object are poor conduct. We will not look upon them kindly! Keep up the great work! 🚀

@@ -177,7 +177,7 @@ function buildTrackingParams(data, info, value) {
const params = Array.isArray(data.params) ? data.params[0] : data.params;
const pageUrl = getPageUrl(null, window);
return {
pid: params.accountId ?? (data.ad?.match(/account: \“([a-f\d]{24})\“/)?.[1] ?? ''),
pid: params.accountId ?? (data.ad?.match(/account: “([a-f\d]{24})“/)?.[1] ?? ''),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curly quotes are surprising

Copy link

Whoa there, partner! 🌵🤠 We wrangled some duplicated code in your PR:

Reducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Please move the common code from both files into a library and import it in each. We hate that we have to mention this, however, commits designed to hide from this utility by renaming variables or reordering an object are poor conduct. We will not look upon them kindly! Keep up the great work! 🚀

@@ -21,7 +21,7 @@ export function fillUsersIds(bidRequest, payload) {
did_pubcid: 'pubcid.org',
did_cruid: 'criteo.com',
did_tdid: 'adserver.org',
did_pbmid: 'regexp:[esp\.]*pubmatic\.com',
did_pbmid: 'regexp:[esp\\.]*pubmatic\\.com',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not equivalent, do we know if it's correct? cc @onlsol

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

esp.pubmatic.com is the one they're looking for I believe

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dgirardi pretty clear it is wrong on further inspection

'regexp:^(?:esp\.)?pubmatic\.com$'
should catch pubmatic.com and esp.pubmatic.com, they are looking for either

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the previous version does look wrong, but I don't share your confidence in asserting that what their backend does is perfectly clear :)

Co-authored-by: Demetrio Girardi <[email protected]>
Copy link

Whoa there, partner! 🌵🤠 We wrangled some duplicated code in your PR:

Reducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Please move the common code from both files into a library and import it in each. We hate that we have to mention this, however, commits designed to hide from this utility by renaming variables or reordering an object are poor conduct. We will not look upon them kindly! Keep up the great work! 🚀

Copy link

Whoa there, partner! 🌵🤠 We wrangled some duplicated code in your PR:

Reducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Please move the common code from both files into a library and import it in each. We hate that we have to mention this, however, commits designed to hide from this utility by renaming variables or reordering an object are poor conduct. We will not look upon them kindly! Keep up the great work! 🚀

fix dspx pubmatic regex
@patmmccann patmmccann requested a review from dgirardi July 29, 2025 17:24
Copy link

Whoa there, partner! 🌵🤠 We wrangled some duplicated code in your PR:

Reducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Please move the common code from both files into a library and import it in each. We hate that we have to mention this, however, commits designed to hide from this utility by renaming variables or reordering an object are poor conduct. We will not look upon them kindly! Keep up the great work! 🚀

Copy link

Tread carefully! This PR adds 2 linter errors (possibly disabled through directives):

  • libraries/dspxUtils/bidderUtils.js (+2 errors)

Copy link
Collaborator

@dgirardi dgirardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some reservations about the pubmatic regex, the newer version does look more plausible but it's also more restrictive. If you know that for example e.pubmatic.com should not be picked up then LGTM

@patmmccann patmmccann merged commit 18beba6 into master Jul 29, 2025
5 of 6 checks passed
@patmmccann patmmccann deleted the lint-no-useless-escape branch July 29, 2025 19:19
@patmmccann
Copy link
Collaborator Author

yeah, i checked with a pubmatic person, those are the only two possible sources

Copy link

Tread carefully! This PR adds 2 linter errors (possibly disabled through directives):

  • libraries/dspxUtils/bidderUtils.js (+2 errors)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants