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

style: format code with Prettier #233

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .yarn/releases/yarn-3.5.1.cjs

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions src/Advertising.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default class Advertising {
this.refreshSlots(selectedSlots)
},
}),
this.onError
this.onError,
)
}

Expand All @@ -91,7 +91,7 @@ export default class Advertising {
this.requestManager.aps = true // signals that APS request has completed
this.refreshSlots(selectedSlots) // checks whether both APS and Prebid have returned
}, this.onError)
}
},
)
} catch (error) {
this.onError(error)
Expand Down Expand Up @@ -139,7 +139,7 @@ export default class Advertising {
this.refreshSlots([slots[id].gpt])
},
}),
this.onError
this.onError,
)
}

Expand All @@ -155,7 +155,7 @@ export default class Advertising {
this.requestManager.aps = true // signals that APS request has completed
this.refreshSlots([slots[id].gpt]) // checks whether both APS and Prebid have returned
}, this.onError)
}
},
)
} catch (error) {
this.onError(error)
Expand Down Expand Up @@ -183,7 +183,7 @@ export default class Advertising {
return
}
Object.keys(this.config.customEvents).forEach((customEventId) =>
this.setupCustomEvent(customEventId, this.config.customEvents[customEventId])
this.setupCustomEvent(customEventId, this.config.customEvents[customEventId]),
)
}

Expand Down Expand Up @@ -211,7 +211,7 @@ export default class Advertising {
return
}
Object.keys(this.config.customEvents).forEach((customEventId) =>
window.removeEventListener('message', this.customEventHandlers[customEventId])
window.removeEventListener('message', this.customEventHandlers[customEventId]),
)
}

Expand Down Expand Up @@ -265,7 +265,7 @@ export default class Advertising {
sizes: sizes.filter(
// APS requires sizes to have type number[][]. Each entry in sizes
// should be an array containing height and width.
(size) => typeof size === 'object' && typeof size[0] === 'number' && typeof size[1] === 'number'
(size) => typeof size === 'object' && typeof size[0] === 'number' && typeof size[1] === 'number',
),
}

Expand All @@ -288,7 +288,7 @@ export default class Advertising {
const { path, targeting } = this.config.interstitialSlot
const slot = window.googletag.defineOutOfPageSlot(
path || this.config.path,
window.googletag.enums.OutOfPageFormat.INTERSTITIAL
window.googletag.enums.OutOfPageFormat.INTERSTITIAL,
)
if (slot) {
const entries = Object.entries(targeting || [])
Expand Down Expand Up @@ -333,9 +333,9 @@ export default class Advertising {
code: currSlot.id,
mediaTypes: currPrebid.mediaTypes,
bids: currPrebid.bids,
}))
})),
),
[]
[],
)
}

Expand Down Expand Up @@ -396,7 +396,7 @@ export default class Advertising {
}
if (this.config.slots) {
this.config.slots = this.config.slots.map((slot) =>
slot.enableLazyLoad === true ? { ...slot, enableLazyLoad: this.defaultLazyLoadConfig } : slot
slot.enableLazyLoad === true ? { ...slot, enableLazyLoad: this.defaultLazyLoadConfig } : slot,
)
}
}
Expand Down Expand Up @@ -443,7 +443,7 @@ export default class Advertising {
} catch (error) {
onError(error)
}
})
}),
)
}
}
2 changes: 1 addition & 1 deletion src/AdvertisingContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const [useProvideAdvertisingContext, useAdvertisingContext] = createInjectionSta
activate,
config,
}
}
},
)

export function useAdvertisingContextWithDefault() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/AdvertisingProvider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const props = withDefaults(
{
active: true,
isPrebid: false,
}
},
)

const { config, plugins, isPrebid, onError } = props
Expand Down Expand Up @@ -87,7 +87,7 @@ watch(
nowConfig.value = advertising.value.config
}
}
}
},
)

watchEffect(async () => {
Expand Down
8 changes: 4 additions & 4 deletions src/components/AdvertisingSlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const props = withDefaults(
top: 0,
}
},
}
},
)
const observerRef = ref<HTMLElement | null>(null)
const { activate, config } = useAdvertisingContextWithDefault()
Expand Down Expand Up @@ -58,12 +58,12 @@ watchEffect(
},
{
rootMargin,
}
},
)

onCleanup(stop)
},
{ flush: 'post' }
{ flush: 'post' },
)

watchEffect(
Expand All @@ -74,7 +74,7 @@ watchEffect(
const { id, customEventHandlers } = props
activate.value(id, customEventHandlers)
},
{ flush: 'post' }
{ flush: 'post' },
)
</script>

Expand Down
6 changes: 3 additions & 3 deletions src/components/GlobalAdvertisingProvider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const props = withDefaults(
{
active: true,
isPrebid: false,
}
},
)

const { config, plugins, isPrebid, onError } = props
Expand All @@ -46,7 +46,7 @@ useHead({
},
{
children: `var new_global_advertising = new global_advertising(${JSON.stringify(
toRaw(config)
toRaw(config),
)}, ${plugins}, ${onError})`,
},
{
Expand Down Expand Up @@ -77,7 +77,7 @@ watch(
await setup_advertising()
}
}
}
},
)
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/GlobalAdvertisingSlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const props = withDefaults(
top: 0,
}
},
}
},
)

const nowSticky = ref(true)
Expand Down
2 changes: 1 addition & 1 deletion src/components/utils/calculateRootMargin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ test.each`
({ marginPercent, isMobileDeviceValue, mobileScaling, expected }) => {
isMobileDevice.mockReturnValue(isMobileDeviceValue)
expect(calculateRootMargin({ marginPercent, mobileScaling })).toBe(expected)
}
},
)
2 changes: 1 addition & 1 deletion src/components/utils/getLazyLoadConfig.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/utils/isLazyLoading.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ test.each`
${{ marginPercent: 0 }} | ${true}
${{ marginPercent: -1 }} | ${false}
`('returns $expected when called with lazy load config $lazyLoadConfig', ({ lazyLoadConfig, expected }) =>
expect(isLazyLoading(lazyLoadConfig)).toBe(expected)
expect(isLazyLoading(lazyLoadConfig)).toBe(expected),
)
4 changes: 2 additions & 2 deletions src/utils/getAdUnits.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default (slots) =>
code: currSlot.id,
mediaTypes: currPrebid.mediaTypes,
bids: currPrebid.bids,
}))
})),
),
[]
[],
)