Skip to content
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

Make eslint aware of the custom import paths #2292

Merged
merged 3 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ module.exports = {
"browser": true,
"commonjs": true
},
"settings": {
"import/resolver": {
"node": {
"moduleDirectory": ["node_modules", "./"]
}
}
},
"extends": "standard",
"globals": {
"$$PREBID_GLOBAL$$": false
Expand Down
13 changes: 6 additions & 7 deletions modules/sonobiBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { registerBidder } from 'src/adapters/bidderFactory';
import { getTopWindowLocation, parseSizesInput } from 'src/utils';
import * as utils from '../src/utils';
import * as utils from 'src/utils';
import { BANNER, VIDEO } from '../src/mediaTypes';
import find from 'core-js/library/fn/array/find';

Expand Down Expand Up @@ -47,7 +46,7 @@ export const spec = {

const payload = {
'key_maker': JSON.stringify(data),
'ref': getTopWindowLocation().host,
'ref': utils.getTopWindowLocation().host,
's': utils.generateUUID(),
'pv': PAGEVIEW_ID,
};
Expand Down Expand Up @@ -139,9 +138,9 @@ export const spec = {

function _validateSize (bid) {
if (bid.params.sizes) {
return parseSizesInput(bid.params.sizes).join(',');
return utils.parseSizesInput(bid.params.sizes).join(',');
}
return parseSizesInput(bid.sizes).join(',');
return utils.parseSizesInput(bid.sizes).join(',');
}

function _validateSlot (bid) {
Expand All @@ -162,12 +161,12 @@ const _creative = (mediaType) => (sbi_dc, sbi_aid) => {
if (mediaType === 'video') {
return _videoCreative(sbi_dc, sbi_aid)
}
const src = 'https://' + sbi_dc + 'apex.go.sonobi.com/sbi.js?aid=' + sbi_aid + '&as=null' + '&ref=' + getTopWindowLocation().host;
const src = 'https://' + sbi_dc + 'apex.go.sonobi.com/sbi.js?aid=' + sbi_aid + '&as=null' + '&ref=' + utils.getTopWindowLocation().host;
return '<script type="text/javascript" src="' + src + '"></script>';
}

function _videoCreative(sbi_dc, sbi_aid) {
return `https://${sbi_dc}apex.go.sonobi.com/vast.xml?vid=${sbi_aid}&ref=${getTopWindowLocation().host}`
return `https://${sbi_dc}apex.go.sonobi.com/vast.xml?vid=${sbi_aid}&ref=${utils.getTopWindowLocation().host}`
}

function _getBidIdFromTrinityKey (key) {
Expand Down
3 changes: 1 addition & 2 deletions src/adapters/bidderFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Adapter from 'src/adapter';
import adaptermanager from 'src/adaptermanager';
import { config } from 'src/config';
import bidfactory from 'src/bidfactory';
import { STATUS } from 'src/constants';
import { userSync } from 'src/userSync';
import { nativeBidIsValid } from 'src/native';
import { isValidVideoBid } from 'src/video';
Expand Down Expand Up @@ -304,7 +303,7 @@ export function newBidder(spec) {
function addBidUsingRequestMap(bid) {
const bidRequest = bidRequestMap[bid.requestId];
if (bidRequest) {
const prebidBid = Object.assign(bidfactory.createBid(STATUS.GOOD, bidRequest), bid);
const prebidBid = Object.assign(bidfactory.createBid(CONSTANTS.STATUS.GOOD, bidRequest), bid);
addBidWithCode(bidRequest.adUnitCode, prebidBid);
} else {
logWarn(`Bidder ${spec.code} made bid for unknown request ID: ${bid.requestId}. Ignoring.`);
Expand Down