diff --git a/.eslintrc.js b/.eslintrc.js index 706768d6a45..8cdd5c498c1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,6 +23,7 @@ module.exports = { "camelcase": "off", "eqeqeq": "off", "import/first": "off", + "new-cap": "off", "no-control-regex": "off", "no-mixed-operators": "off", "no-multiple-empty-lines": "off", diff --git a/gulpfile.js b/gulpfile.js index 2572420904d..ed7cc4a5a8f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -207,7 +207,7 @@ gulp.task('watch', function () { }); gulp.task('lint', () => { - return gulp.src(['src/**/*.js', 'test/**/*.js']) + return gulp.src(['src/**/*.js', 'modules/**/*.js', 'test/**/*.js']) .pipe(eslint()) .pipe(eslint.format('stylish')) .pipe(eslint.failAfterError()); diff --git a/modules/aardvarkBidAdapter.js b/modules/aardvarkBidAdapter.js index 65c90b3be47..a058c90fa9b 100644 --- a/modules/aardvarkBidAdapter.js +++ b/modules/aardvarkBidAdapter.js @@ -42,7 +42,7 @@ var AARDVARK_CALLBACK_NAME = 'aardvarkResponse', bidIds.push(_sc + '=' + bid.bidId); - // Create the bidIdsMap for easier mapping back later + // Create the bidIdsMap for easier mapping back later $$PREBID_GLOBAL$$[AARDVARK_REQUESTS_MAP][bidderCode][bid.bidId] = bid; } @@ -124,6 +124,6 @@ exports.createNew = function() { return new AardvarkAdapter(); }; -adaptermanager.registerBidAdapter(new AardvarkAdapter, 'aardvark'); +adaptermanager.registerBidAdapter(new AardvarkAdapter(), 'aardvark'); module.exports = AardvarkAdapter; diff --git a/modules/adbladeBidAdapter.js b/modules/adbladeBidAdapter.js index ab0a7a83cb3..ee1fcca86f7 100644 --- a/modules/adbladeBidAdapter.js +++ b/modules/adbladeBidAdapter.js @@ -130,6 +130,6 @@ var AdbladeAdapter = function AdbladeAdapter() { }; }; -adaptermanager.registerBidAdapter(new AdbladeAdapter, 'adblade'); +adaptermanager.registerBidAdapter(new AdbladeAdapter(), 'adblade'); module.exports = AdbladeAdapter; diff --git a/modules/adbundBidAdapter.js b/modules/adbundBidAdapter.js index a7c2bd45257..2971d881f7b 100644 --- a/modules/adbundBidAdapter.js +++ b/modules/adbundBidAdapter.js @@ -64,6 +64,6 @@ var adBundAdapter = function adBundAdapter() { }; }; -adaptermanager.registerBidAdapter(new adBundAdapter, 'adbund'); +adaptermanager.registerBidAdapter(new adBundAdapter(), 'adbund'); module.exports = adBundAdapter; diff --git a/modules/adbutlerBidAdapter.js b/modules/adbutlerBidAdapter.js index 8fbbba305ac..a253c494d6c 100644 --- a/modules/adbutlerBidAdapter.js +++ b/modules/adbutlerBidAdapter.js @@ -139,6 +139,6 @@ var AdButlerAdapter = function AdButlerAdapter() { }; }; -adaptermanager.registerBidAdapter(new AdButlerAdapter, 'adbutler'); +adaptermanager.registerBidAdapter(new AdButlerAdapter(), 'adbutler'); module.exports = AdButlerAdapter; diff --git a/modules/adequantBidAdapter.js b/modules/adequantBidAdapter.js index b45b976ac28..982ea4adbde 100644 --- a/modules/adequantBidAdapter.js +++ b/modules/adequantBidAdapter.js @@ -73,6 +73,6 @@ function AdequantAdapter() { }; } -adaptermanager.registerBidAdapter(new AdequantAdapter, 'adequant'); +adaptermanager.registerBidAdapter(new AdequantAdapter(), 'adequant'); module.exports = AdequantAdapter; diff --git a/modules/adformBidAdapter.js b/modules/adformBidAdapter.js index 7f7cc13d059..5d1bb98b4ec 100644 --- a/modules/adformBidAdapter.js +++ b/modules/adformBidAdapter.js @@ -162,6 +162,6 @@ function AdformAdapter() { } } -adaptermanager.registerBidAdapter(new AdformAdapter, 'adform'); +adaptermanager.registerBidAdapter(new AdformAdapter(), 'adform'); module.exports = AdformAdapter; diff --git a/modules/adkernelBidAdapter.js b/modules/adkernelBidAdapter.js index a9c5796b07e..ad3cbeb334b 100644 --- a/modules/adkernelBidAdapter.js +++ b/modules/adkernelBidAdapter.js @@ -307,7 +307,7 @@ AdKernelAdapter.createNew = function() { return new AdKernelAdapter(); }; -adaptermanager.registerBidAdapter(new AdKernelAdapter, 'adkernel', { +adaptermanager.registerBidAdapter(new AdKernelAdapter(), 'adkernel', { supportedMediaTypes: ['video'] }); adaptermanager.aliasBidAdapter('adkernel', 'headbidding'); diff --git a/modules/admediaBidAdapter.js b/modules/admediaBidAdapter.js index e933911d537..ff21fba3101 100644 --- a/modules/admediaBidAdapter.js +++ b/modules/admediaBidAdapter.js @@ -100,6 +100,6 @@ var AdmediaAdapter = function AdmediaAdapter() { }; }; -adaptermanager.registerBidAdapter(new AdmediaAdapter, 'admedia'); +adaptermanager.registerBidAdapter(new AdmediaAdapter(), 'admedia'); module.exports = AdmediaAdapter; diff --git a/modules/admixerBidAdapter.js b/modules/admixerBidAdapter.js index d0b4515133a..71220732540 100644 --- a/modules/admixerBidAdapter.js +++ b/modules/admixerBidAdapter.js @@ -81,7 +81,7 @@ var AdmixerAdapter = function AdmixerAdapter() { }; }; -adaptermanager.registerBidAdapter(new AdmixerAdapter, 'admixer', { +adaptermanager.registerBidAdapter(new AdmixerAdapter(), 'admixer', { supportedMediaTypes: ['video'] }); diff --git a/modules/adsupplyBidAdapter.js b/modules/adsupplyBidAdapter.js index 8d7aa1ef4a6..041437cce98 100644 --- a/modules/adsupplyBidAdapter.js +++ b/modules/adsupplyBidAdapter.js @@ -85,6 +85,6 @@ var AdSupplyAdapter = function AdSupplyAdapter() { }; }; -adaptermanager.registerBidAdapter(new AdSupplyAdapter, 'adsupply'); +adaptermanager.registerBidAdapter(new AdSupplyAdapter(), 'adsupply'); module.exports = AdSupplyAdapter; diff --git a/modules/adyoulikeBidAdapter.js b/modules/adyoulikeBidAdapter.js index b9e958ac16b..f58292b0fae 100644 --- a/modules/adyoulikeBidAdapter.js +++ b/modules/adyoulikeBidAdapter.js @@ -199,6 +199,6 @@ AdyoulikeAdapter.createNew = function () { return new AdyoulikeAdapter(); }; -adaptermanager.registerBidAdapter(new AdyoulikeAdapter, 'adyoulike'); +adaptermanager.registerBidAdapter(new AdyoulikeAdapter(), 'adyoulike'); module.exports = AdyoulikeAdapter; diff --git a/modules/aolBidAdapter.js b/modules/aolBidAdapter.js index 1f0b3a5bbb0..42aff892b75 100644 --- a/modules/aolBidAdapter.js +++ b/modules/aolBidAdapter.js @@ -303,6 +303,6 @@ const AolAdapter = function AolAdapter() { }; }; -adaptermanager.registerBidAdapter(new AolAdapter, 'aol'); +adaptermanager.registerBidAdapter(new AolAdapter(), 'aol'); module.exports = AolAdapter; diff --git a/modules/appnexusAstBidAdapter.js b/modules/appnexusAstBidAdapter.js index 0cb372bcc55..284d8eef10b 100644 --- a/modules/appnexusAstBidAdapter.js +++ b/modules/appnexusAstBidAdapter.js @@ -193,7 +193,7 @@ function AppnexusAstAdapter() { utils.logError(`${type} ad type not supported`); } - tag.bidId = tag.uuid; // bidfactory looks for bidId on requested bid + tag.bidId = tag.uuid; // bidfactory looks for bidId on requested bid const bid = createBid(status, tag); if (type === 'native') bid.mediaType = 'native'; if (type === 'video') bid.mediaType = 'video'; @@ -378,7 +378,7 @@ AppnexusAstAdapter.createNew = function() { return new AppnexusAstAdapter(); }; -adaptermanager.registerBidAdapter(new AppnexusAstAdapter, 'appnexusAst', { +adaptermanager.registerBidAdapter(new AppnexusAstAdapter(), 'appnexusAst', { supportedMediaTypes: ['video', 'native'] }); diff --git a/modules/appnexusBidAdapter.js b/modules/appnexusBidAdapter.js index 46b08314d7b..a20b7f29e47 100644 --- a/modules/appnexusBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -226,7 +226,7 @@ AppNexusAdapter.createNew = function () { return new AppNexusAdapter(); }; -adaptermanager.registerBidAdapter(new AppNexusAdapter, 'appnexus'); +adaptermanager.registerBidAdapter(new AppNexusAdapter(), 'appnexus'); adaptermanager.aliasBidAdapter('appnexus', 'brealtime'); adaptermanager.aliasBidAdapter('appnexus', 'pagescience'); adaptermanager.aliasBidAdapter('appnexus', 'defymedia'); diff --git a/modules/atomxBidAdapter.js b/modules/atomxBidAdapter.js index 9acf2339af9..5b8652561eb 100644 --- a/modules/atomxBidAdapter.js +++ b/modules/atomxBidAdapter.js @@ -74,6 +74,6 @@ var AtomxAdapter = function AtomxAdapter() { }; -adaptermanager.registerBidAdapter(new AtomxAdapter, 'atomx'); +adaptermanager.registerBidAdapter(new AtomxAdapter(), 'atomx'); module.exports = AtomxAdapter; diff --git a/modules/audienceNetworkBidAdapter.js b/modules/audienceNetworkBidAdapter.js index d19bf4d9278..0a67020b86d 100644 --- a/modules/audienceNetworkBidAdapter.js +++ b/modules/audienceNetworkBidAdapter.js @@ -244,7 +244,7 @@ const callBids = bidRequest => { */ const AudienceNetwork = () => ({ callBids, setBidderCode, getBidderCode }); -adaptermanager.registerBidAdapter(new AudienceNetwork, 'audienceNetwork', { +adaptermanager.registerBidAdapter(new AudienceNetwork(), 'audienceNetwork', { supportedMediaTypes: ['video'] }); diff --git a/modules/beachfrontBidAdapter.js b/modules/beachfrontBidAdapter.js index 059d15ac79d..29434a35c0c 100644 --- a/modules/beachfrontBidAdapter.js +++ b/modules/beachfrontBidAdapter.js @@ -133,7 +133,7 @@ BeachfrontAdapter.createNew = function () { return new BeachfrontAdapter(); }; -adaptermanager.registerBidAdapter(new BeachfrontAdapter, 'beachfront', { +adaptermanager.registerBidAdapter(new BeachfrontAdapter(), 'beachfront', { supportedMediaTypes: ['video'] }); diff --git a/modules/bidfluenceBidAdapter.js b/modules/bidfluenceBidAdapter.js index da22096b7e6..73b548a4993 100644 --- a/modules/bidfluenceBidAdapter.js +++ b/modules/bidfluenceBidAdapter.js @@ -53,6 +53,6 @@ var BidfluenceAdapter = function BidfluenceAdapter() { }; }; -adaptermanager.registerBidAdapter(new BidfluenceAdapter, 'bidfluence'); +adaptermanager.registerBidAdapter(new BidfluenceAdapter(), 'bidfluence'); module.exports = BidfluenceAdapter; diff --git a/modules/brightcomBidAdapter.js b/modules/brightcomBidAdapter.js index 2f6d30275ea..c8945e58f91 100644 --- a/modules/brightcomBidAdapter.js +++ b/modules/brightcomBidAdapter.js @@ -122,7 +122,7 @@ var BrightcomAdapter = function BrightcomAdapter() { // Make sure response is valid if ( - (brightcomResponseObj) && (brightcomResponseObj.id) && + (brightcomResponseObj) && (brightcomResponseObj.id) && (brightcomResponseObj.seatbid) && (brightcomResponseObj.seatbid.length !== 0) && (brightcomResponseObj.seatbid[0].bid) && (brightcomResponseObj.seatbid[0].bid.length !== 0) ) { @@ -200,6 +200,6 @@ var BrightcomAdapter = function BrightcomAdapter() { }; }; -adaptermanager.registerBidAdapter(new BrightcomAdapter, 'brightcom'); +adaptermanager.registerBidAdapter(new BrightcomAdapter(), 'brightcom'); module.exports = BrightcomAdapter; diff --git a/modules/carambolaBidAdapter.js b/modules/carambolaBidAdapter.js index ae064e93ce1..3c65e7da77e 100644 --- a/modules/carambolaBidAdapter.js +++ b/modules/carambolaBidAdapter.js @@ -191,6 +191,6 @@ function CarambolaAdapter() { }; } -adaptermanager.registerBidAdapter(new CarambolaAdapter, 'carambola'); +adaptermanager.registerBidAdapter(new CarambolaAdapter(), 'carambola'); module.exports = CarambolaAdapter; diff --git a/modules/centroBidAdapter.js b/modules/centroBidAdapter.js index 0a218b57f64..59abe7cec15 100644 --- a/modules/centroBidAdapter.js +++ b/modules/centroBidAdapter.js @@ -117,6 +117,6 @@ var CentroAdapter = function CentroAdapter() { }; }; -adaptermanager.registerBidAdapter(new CentroAdapter, 'centro'); +adaptermanager.registerBidAdapter(new CentroAdapter(), 'centro'); module.exports = CentroAdapter; diff --git a/modules/conversantBidAdapter.js b/modules/conversantBidAdapter.js index 12984b521db..d51008559f2 100644 --- a/modules/conversantBidAdapter.js +++ b/modules/conversantBidAdapter.js @@ -271,7 +271,7 @@ var ConversantAdapter = function () { }; }; -adaptermanager.registerBidAdapter(new ConversantAdapter, 'conversant', { +adaptermanager.registerBidAdapter(new ConversantAdapter(), 'conversant', { supportedMediaTypes: ['video'] }); diff --git a/modules/coxBidAdapter.js b/modules/coxBidAdapter.js index 0d0f5047c06..432b82ebf88 100644 --- a/modules/coxBidAdapter.js +++ b/modules/coxBidAdapter.js @@ -253,6 +253,6 @@ function CoxAdapter() { }; } -adaptermanager.registerBidAdapter(new CoxAdapter, 'cox'); +adaptermanager.registerBidAdapter(new CoxAdapter(), 'cox'); module.exports = CoxAdapter; diff --git a/modules/criteoBidAdapter.js b/modules/criteoBidAdapter.js index 7a83ad9ff29..8fd74ff83fa 100644 --- a/modules/criteoBidAdapter.js +++ b/modules/criteoBidAdapter.js @@ -51,7 +51,7 @@ var CriteoAdapter = function CriteoAdapter() { bid.transactionId, sizes.map((size) => { return { width: size[0], height: size[1] } - } + } ) ) ); @@ -144,6 +144,6 @@ var CriteoAdapter = function CriteoAdapter() { }; }; -adaptermanager.registerBidAdapter(new CriteoAdapter, 'criteo'); +adaptermanager.registerBidAdapter(new CriteoAdapter(), 'criteo'); module.exports = CriteoAdapter; diff --git a/modules/districtmDMXBidAdapter.js b/modules/districtmDMXBidAdapter.js index d07985097ef..65a51ecc475 100644 --- a/modules/districtmDMXBidAdapter.js +++ b/modules/districtmDMXBidAdapter.js @@ -51,6 +51,6 @@ var DistrictmAdaptor = function districtmAdaptor() { }; }; -adaptermanager.registerBidAdapter(new DistrictmAdaptor, 'districtmDMX'); +adaptermanager.registerBidAdapter(new DistrictmAdaptor(), 'districtmDMX'); module.exports = DistrictmAdaptor; diff --git a/modules/eplanningBidAdapter.js b/modules/eplanningBidAdapter.js index b0d610d1676..aa2e0d8cea7 100644 --- a/modules/eplanningBidAdapter.js +++ b/modules/eplanningBidAdapter.js @@ -278,6 +278,6 @@ function EPlanningAdapter() { }; } -adaptermanager.registerBidAdapter(new EPlanningAdapter, 'eplanning'); +adaptermanager.registerBidAdapter(new EPlanningAdapter(), 'eplanning'); module.exports = EPlanningAdapter; diff --git a/modules/express.js b/modules/express.js index 8a855245e36..20921276cfe 100644 --- a/modules/express.js +++ b/modules/express.js @@ -14,14 +14,13 @@ const MODULE_NAME = 'express'; * @param {Object[]} [adUnits = pbjs.adUnits] - an array of adUnits for express to operate on. */ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) { - utils.logMessage('loading ' + MODULE_NAME); if (adUnits.length === 0) { utils.logWarn('no valid adUnits found, not loading ' + MODULE_NAME); } -// put adUnits in a more performant hash lookup by code. + // put adUnits in a more performant hash lookup by code. var adUnitsCache = adUnits.reduce(function (cache, adUnit) { if (adUnit.code && adUnit.bids) { cache[adUnit.code] = adUnit; @@ -59,9 +58,9 @@ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) { // a helper function to verify slots or get slots if not present function defaultSlots(slots) { - return Array.isArray(slots) ? - slots.slice() : - googletag.pubads().getSlots().slice(); + return Array.isArray(slots) + ? slots.slice() + : googletag.pubads().getSlots().slice(); } // maps gpt slots to adUnits, matches are copied to new array and removed from passed array. @@ -150,7 +149,6 @@ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) { }); } } - }; // override gpt refresh() function @@ -205,5 +203,4 @@ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) { return fGptEnableSingleRequest.apply(window.googletag.pubads(), arguments); }; }); - }; diff --git a/modules/fidelityBidAdapter.js b/modules/fidelityBidAdapter.js index 2bd585c15c1..73ee9d44ddd 100644 --- a/modules/fidelityBidAdapter.js +++ b/modules/fidelityBidAdapter.js @@ -97,6 +97,6 @@ var FidelityAdapter = function FidelityAdapter() { }; }; -adaptermanager.registerBidAdapter(new FidelityAdapter, 'fidelity'); +adaptermanager.registerBidAdapter(new FidelityAdapter(), 'fidelity'); module.exports = FidelityAdapter; diff --git a/modules/getintentBidAdapter.js b/modules/getintentBidAdapter.js index 909b767e508..6dc2cb9f4da 100644 --- a/modules/getintentBidAdapter.js +++ b/modules/getintentBidAdapter.js @@ -70,7 +70,7 @@ var GetIntentAdapter = function GetIntentAdapter() { }; }; -adaptermanager.registerBidAdapter(new GetIntentAdapter, 'getintent', { +adaptermanager.registerBidAdapter(new GetIntentAdapter(), 'getintent', { supportedMediaTypes: ['video'] }); diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 7d99cfbff69..7aff53fbcc6 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -58,9 +58,9 @@ const GumgumAdapter = function GumgumAdapter() { utils._each(bids, bidRequest => { const { bidId - , params = {} - , placementCode - } = bidRequest; + , params = {} + , placementCode + } = bidRequest; const timestamp = _getTimeStamp(); const trackingId = params.inScreen; const nativeId = params.native; @@ -118,11 +118,11 @@ const GumgumAdapter = function GumgumAdapter() { const _handleGumGumResponse = cachedBidRequest => (bidResponse = {}) => { const { pi: productId - } = cachedBidRequest; + } = cachedBidRequest; const { ad = {} - , pag = {} - , thms: throttle - } = bidResponse; + , pag = {} + , thms: throttle + } = bidResponse; /* cache the pageViewId */ if (pag && pag.pvid) pageViewId = pag.pvid; if (ad && ad.id) { @@ -131,7 +131,7 @@ const GumgumAdapter = function GumgumAdapter() { /* create the bid */ const bid = bidfactory.createBid(1); const { t: trackingId - } = pag; + } = pag; bidResponse.request = cachedBidRequest; const encodedResponse = encodeURIComponent(JSON.stringify(bidResponse)); const gumgumAdLoader = `