Skip to content

Commit

Permalink
Lint modules directory (prebid#1404)
Browse files Browse the repository at this point in the history
* Lint modules directory

* Run --fix

* Add indentation exception for adapter

* Push lint error to test CI

* Fix forced error
  • Loading branch information
matthewlane authored Jul 24, 2017
1 parent 74b0dc3 commit 19705b3
Show file tree
Hide file tree
Showing 81 changed files with 212 additions and 213 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions modules/aardvarkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -124,6 +124,6 @@ exports.createNew = function() {
return new AardvarkAdapter();
};

adaptermanager.registerBidAdapter(new AardvarkAdapter, 'aardvark');
adaptermanager.registerBidAdapter(new AardvarkAdapter(), 'aardvark');

module.exports = AardvarkAdapter;
2 changes: 1 addition & 1 deletion modules/adbladeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ var AdbladeAdapter = function AdbladeAdapter() {
};
};

adaptermanager.registerBidAdapter(new AdbladeAdapter, 'adblade');
adaptermanager.registerBidAdapter(new AdbladeAdapter(), 'adblade');

module.exports = AdbladeAdapter;
2 changes: 1 addition & 1 deletion modules/adbundBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ var adBundAdapter = function adBundAdapter() {
};
};

adaptermanager.registerBidAdapter(new adBundAdapter, 'adbund');
adaptermanager.registerBidAdapter(new adBundAdapter(), 'adbund');

module.exports = adBundAdapter;
2 changes: 1 addition & 1 deletion modules/adbutlerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ var AdButlerAdapter = function AdButlerAdapter() {
};
};

adaptermanager.registerBidAdapter(new AdButlerAdapter, 'adbutler');
adaptermanager.registerBidAdapter(new AdButlerAdapter(), 'adbutler');

module.exports = AdButlerAdapter;
2 changes: 1 addition & 1 deletion modules/adequantBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ function AdequantAdapter() {
};
}

adaptermanager.registerBidAdapter(new AdequantAdapter, 'adequant');
adaptermanager.registerBidAdapter(new AdequantAdapter(), 'adequant');

module.exports = AdequantAdapter;
2 changes: 1 addition & 1 deletion modules/adformBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,6 @@ function AdformAdapter() {
}
}

adaptermanager.registerBidAdapter(new AdformAdapter, 'adform');
adaptermanager.registerBidAdapter(new AdformAdapter(), 'adform');

module.exports = AdformAdapter;
2 changes: 1 addition & 1 deletion modules/adkernelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion modules/admediaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ var AdmediaAdapter = function AdmediaAdapter() {
};
};

adaptermanager.registerBidAdapter(new AdmediaAdapter, 'admedia');
adaptermanager.registerBidAdapter(new AdmediaAdapter(), 'admedia');

module.exports = AdmediaAdapter;
2 changes: 1 addition & 1 deletion modules/admixerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var AdmixerAdapter = function AdmixerAdapter() {
};
};

adaptermanager.registerBidAdapter(new AdmixerAdapter, 'admixer', {
adaptermanager.registerBidAdapter(new AdmixerAdapter(), 'admixer', {
supportedMediaTypes: ['video']
});

Expand Down
2 changes: 1 addition & 1 deletion modules/adsupplyBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ var AdSupplyAdapter = function AdSupplyAdapter() {
};
};

adaptermanager.registerBidAdapter(new AdSupplyAdapter, 'adsupply');
adaptermanager.registerBidAdapter(new AdSupplyAdapter(), 'adsupply');

module.exports = AdSupplyAdapter;
2 changes: 1 addition & 1 deletion modules/adyoulikeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,6 @@ AdyoulikeAdapter.createNew = function () {
return new AdyoulikeAdapter();
};

adaptermanager.registerBidAdapter(new AdyoulikeAdapter, 'adyoulike');
adaptermanager.registerBidAdapter(new AdyoulikeAdapter(), 'adyoulike');

module.exports = AdyoulikeAdapter;
2 changes: 1 addition & 1 deletion modules/aolBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,6 @@ const AolAdapter = function AolAdapter() {
};
};

adaptermanager.registerBidAdapter(new AolAdapter, 'aol');
adaptermanager.registerBidAdapter(new AolAdapter(), 'aol');

module.exports = AolAdapter;
4 changes: 2 additions & 2 deletions modules/appnexusAstBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -378,7 +378,7 @@ AppnexusAstAdapter.createNew = function() {
return new AppnexusAstAdapter();
};

adaptermanager.registerBidAdapter(new AppnexusAstAdapter, 'appnexusAst', {
adaptermanager.registerBidAdapter(new AppnexusAstAdapter(), 'appnexusAst', {
supportedMediaTypes: ['video', 'native']
});

Expand Down
2 changes: 1 addition & 1 deletion modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion modules/atomxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ var AtomxAdapter = function AtomxAdapter() {
};


adaptermanager.registerBidAdapter(new AtomxAdapter, 'atomx');
adaptermanager.registerBidAdapter(new AtomxAdapter(), 'atomx');

module.exports = AtomxAdapter;
2 changes: 1 addition & 1 deletion modules/audienceNetworkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ const callBids = bidRequest => {
*/
const AudienceNetwork = () => ({ callBids, setBidderCode, getBidderCode });

adaptermanager.registerBidAdapter(new AudienceNetwork, 'audienceNetwork', {
adaptermanager.registerBidAdapter(new AudienceNetwork(), 'audienceNetwork', {
supportedMediaTypes: ['video']
});

Expand Down
2 changes: 1 addition & 1 deletion modules/beachfrontBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ BeachfrontAdapter.createNew = function () {
return new BeachfrontAdapter();
};

adaptermanager.registerBidAdapter(new BeachfrontAdapter, 'beachfront', {
adaptermanager.registerBidAdapter(new BeachfrontAdapter(), 'beachfront', {
supportedMediaTypes: ['video']
});

Expand Down
2 changes: 1 addition & 1 deletion modules/bidfluenceBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ var BidfluenceAdapter = function BidfluenceAdapter() {
};
};

adaptermanager.registerBidAdapter(new BidfluenceAdapter, 'bidfluence');
adaptermanager.registerBidAdapter(new BidfluenceAdapter(), 'bidfluence');

module.exports = BidfluenceAdapter;
4 changes: 2 additions & 2 deletions modules/brightcomBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
) {
Expand Down Expand Up @@ -200,6 +200,6 @@ var BrightcomAdapter = function BrightcomAdapter() {
};
};

adaptermanager.registerBidAdapter(new BrightcomAdapter, 'brightcom');
adaptermanager.registerBidAdapter(new BrightcomAdapter(), 'brightcom');

module.exports = BrightcomAdapter;
2 changes: 1 addition & 1 deletion modules/carambolaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,6 @@ function CarambolaAdapter() {
};
}

adaptermanager.registerBidAdapter(new CarambolaAdapter, 'carambola');
adaptermanager.registerBidAdapter(new CarambolaAdapter(), 'carambola');

module.exports = CarambolaAdapter;
2 changes: 1 addition & 1 deletion modules/centroBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ var CentroAdapter = function CentroAdapter() {
};
};

adaptermanager.registerBidAdapter(new CentroAdapter, 'centro');
adaptermanager.registerBidAdapter(new CentroAdapter(), 'centro');

module.exports = CentroAdapter;
2 changes: 1 addition & 1 deletion modules/conversantBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ var ConversantAdapter = function () {
};
};

adaptermanager.registerBidAdapter(new ConversantAdapter, 'conversant', {
adaptermanager.registerBidAdapter(new ConversantAdapter(), 'conversant', {
supportedMediaTypes: ['video']
});

Expand Down
2 changes: 1 addition & 1 deletion modules/coxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,6 @@ function CoxAdapter() {
};
}

adaptermanager.registerBidAdapter(new CoxAdapter, 'cox');
adaptermanager.registerBidAdapter(new CoxAdapter(), 'cox');

module.exports = CoxAdapter;
4 changes: 2 additions & 2 deletions modules/criteoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var CriteoAdapter = function CriteoAdapter() {
bid.transactionId,
sizes.map((size) => {
return { width: size[0], height: size[1] }
}
}
)
)
);
Expand Down Expand Up @@ -144,6 +144,6 @@ var CriteoAdapter = function CriteoAdapter() {
};
};

adaptermanager.registerBidAdapter(new CriteoAdapter, 'criteo');
adaptermanager.registerBidAdapter(new CriteoAdapter(), 'criteo');

module.exports = CriteoAdapter;
2 changes: 1 addition & 1 deletion modules/districtmDMXBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ var DistrictmAdaptor = function districtmAdaptor() {
};
};

adaptermanager.registerBidAdapter(new DistrictmAdaptor, 'districtmDMX');
adaptermanager.registerBidAdapter(new DistrictmAdaptor(), 'districtmDMX');

module.exports = DistrictmAdaptor;
2 changes: 1 addition & 1 deletion modules/eplanningBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,6 @@ function EPlanningAdapter() {
};
}

adaptermanager.registerBidAdapter(new EPlanningAdapter, 'eplanning');
adaptermanager.registerBidAdapter(new EPlanningAdapter(), 'eplanning');

module.exports = EPlanningAdapter;
11 changes: 4 additions & 7 deletions modules/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -150,7 +149,6 @@ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) {
});
}
}

};

// override gpt refresh() function
Expand Down Expand Up @@ -205,5 +203,4 @@ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) {
return fGptEnableSingleRequest.apply(window.googletag.pubads(), arguments);
};
});

};
2 changes: 1 addition & 1 deletion modules/fidelityBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ var FidelityAdapter = function FidelityAdapter() {
};
};

adaptermanager.registerBidAdapter(new FidelityAdapter, 'fidelity');
adaptermanager.registerBidAdapter(new FidelityAdapter(), 'fidelity');

module.exports = FidelityAdapter;
2 changes: 1 addition & 1 deletion modules/getintentBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var GetIntentAdapter = function GetIntentAdapter() {
};
};

adaptermanager.registerBidAdapter(new GetIntentAdapter, 'getintent', {
adaptermanager.registerBidAdapter(new GetIntentAdapter(), 'getintent', {
supportedMediaTypes: ['video']
});

Expand Down
18 changes: 9 additions & 9 deletions modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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 = `<script>
Expand Down Expand Up @@ -171,6 +171,6 @@ const GumgumAdapter = function GumgumAdapter() {
};
};

adaptermanager.registerBidAdapter(new GumgumAdapter, 'gumgum');
adaptermanager.registerBidAdapter(new GumgumAdapter(), 'gumgum');

module.exports = GumgumAdapter;
2 changes: 1 addition & 1 deletion modules/hiromediaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,6 @@ var HiroMediaAdapter = function HiroMediaAdapter() {
*/
};

adaptermanager.registerBidAdapter(new HiroMediaAdapter, 'hiromedia');
adaptermanager.registerBidAdapter(new HiroMediaAdapter(), 'hiromedia');

module.exports = HiroMediaAdapter;
Loading

0 comments on commit 19705b3

Please sign in to comment.