Skip to content

Commit

Permalink
chore: linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Mar 29, 2024
1 parent f2733e8 commit ecbb9a3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ below table for the available scripts.
| `hotjar` | Hotjar | `useScriptHotjar` | Core |
| `intercom` | Intercom | `useScriptIntercom` | Core |
| `segment` | Segment | `useScriptSegment` | Core |
| `google-analytics` | Google Analytics | `useGoogleAnalytics` | [Nuxt Third Party Capital](https://github.com/nuxt/third-party-capital) |
| `google-tag-manager` | Google Tag Manager | `useGoogleTagManager` | [Nuxt Third Party Capital](https://github.com/nuxt/third-party-capital) |
| `google-analytics` | Google Analytics | `useScriptGoogleAnalytics` | [Nuxt Third Party Capital](https://github.com/nuxt/third-party-capital) |
| `google-tag-manager` | Google Tag Manager | `useScriptGoogleTagManager` | [Nuxt Third Party Capital](https://github.com/nuxt/third-party-capital) |
| `google-maps` | Google Maps | `useScriptGoogleMaps` | [Nuxt Third Party Capital](https://github.com/nuxt/third-party-capital) |
| `cloudflare-turnstile` | CloudFlare Turnstile | `useCloudflareTurnstile` | [Nuxt Cloudflare Turnstile](https://github.com/nuxt-modules/turnstile) |

TODO | `twitter-pixel` | Twitter Pixel | `useTwitterPixel` |
Expand Down
8 changes: 1 addition & 7 deletions playground/pages/third-parties/hotjar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { useHead, useScriptHotjar, watch } from '#imports'
import { useHead, useScriptHotjar } from '#imports'
useHead({
title: 'Hotjar',
Expand All @@ -9,12 +9,6 @@ useHead({
const { $script, hj } = useScriptHotjar({ id: 3925006, sv: 6 })
// this will be triggered once the script is ready async
hj('identify', '123456', { test: 'foo' })
console.log(typeof $script.status)
watch($script.status, (status) => {
console.log('hj', status)
})
</script>

<template>
Expand Down
1 change: 0 additions & 1 deletion playground/pages/third-parties/intercom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ useHead({
// composables return the underlying api as a proxy object and a $script with the script state
const instance = useScriptIntercom({ app_id: 'nu034r2a' })
const { $script, Intercom } = instance
console.log('STATUS', typeof $script.status, $script)
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/registry/facebook-pixel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function useScriptFacebookPixel<T extends FacebookPixelApi>(options?: Inp
if (import.meta.client) {
const fbq: FacebookPixelApi['fbq'] = window.fbq = function (...params: any[]) {
// @ts-expect-error untyped
fbq.callMethod ? fbq.callMethod.apply(fbq, params) : fbq.queue.push(params)
fbq.callMethod ? fbq.callMethod(...params) : fbq.queue.push(params)
} as any as FacebookPixelApi['fbq']
if (!window._fbq)
window._fbq = fbq
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/registry/segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export function useScriptSegment<T extends SegmentApi>(options?: Input<typeof Se
window.analytics = window.analytics || []
window.analytics.methods = ['track', 'page', 'identify', 'group', 'alias', 'reset']
window.analytics.factory = function (method) {
return function () {
const args = Array.prototype.slice.call(arguments)
return function (...params: any[]) {
const args = Array.prototype.slice.call(params)
args.unshift(method)
window.analytics.push(args)
return window.analytics
Expand Down

0 comments on commit ecbb9a3

Please sign in to comment.