Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tstirrat15 committed Jan 23, 2025
1 parent b96077d commit 51749ff
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/FullPlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ export function ThemedAppView(props: { datastore: DataStore }) {
>(undefined);

const conductValidation = () => {
validationService.conductValidation((validated: boolean) => {
validationService.conductValidation(() => {
return false;
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/playground-ui/ConfirmDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import DialogTitle from "@material-ui/core/DialogTitle";
import TextField from "@material-ui/core/TextField";
import React, { useState } from "react";

export type ConfirmValue = "undefined" | "load" | "replace"
export type ConfirmValue = "undefined" | "load" | "replace" | "nevermind"

/**
* ConfirmDialogButton is a button in the confirm dialog.
Expand Down
2 changes: 1 addition & 1 deletion src/playground-ui/DiscordChatCrate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const loadFromCDN = () =>
script.src = CDN_URL;
document.head.appendChild(script);

script.onload = () => resolve((window as any).Crate);
script.onload = () => resolve(window.Crate);
script.onerror = () => reject('Failed to load Crate!');
});

Expand Down
15 changes: 9 additions & 6 deletions src/playground-ui/GoogleAnalyticsHook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { useEffect } from 'react';

declare global {
interface Window {
gtag: (kind: string, subkind: any, data?: Record<string, any>) => any
dataLayer: any[];
gtag: (kind: string, subkind: object | string, data?: Record<string, object | string | boolean>) => object
dataLayer: object[];
}
}

Expand Down Expand Up @@ -36,6 +36,9 @@ export const useGoogleAnalytics = (measurementId?: string) => {
if (measurementId && !tagInjected) {
// Configure Tags Manager.
window.dataLayer = window.dataLayer || [];
// As of 2025-01 we're probably going to get rid of this file soon in favor
// of GTM.
// eslint-disable-next-line prefer-rest-params
window.gtag = window.gtag || function () { window.dataLayer.push(arguments) };
window.gtag('js', new Date());
window.gtag('config', measurementId);
Expand All @@ -54,25 +57,25 @@ export const useGoogleAnalytics = (measurementId?: string) => {
}
});

const pushEvent = (eventName: string, eventParams: Record<string, any>) => {
const pushEvent = (eventName: string, eventParams: Record<string, object | string | boolean>) => {
if (!tagInjected) {
return
}
window.gtag('event', eventName, eventParams);
};

const setValue = (valueKey: string, value: Record<string, any>) => {
const setValue = (valueKey: string, value: Record<string, object>) => {
if (!tagInjected) {
return
}
window.gtag('set', valueKey, value);
};

const setUser = (userData: Record<string, any>) => {
const setUser = (userData: Record<string, object>) => {
if (userSet) { return; }
setValue('user', userData);
userSet = true;
};

return { initialized: !!measurementId, setValue: setValue, pushEvent: pushEvent, setUser: setUser };
};
};
4 changes: 2 additions & 2 deletions src/playground-ui/TabPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export interface TabPanelProps {
/**
* index is the index for which, if the value matches, the tab is displayed.
*/
index: any;
index: string;

/**
* value is the current tab value.
*/
value: any;
value: string;

/**
* className is the custom classname for the TabPanel.
Expand Down

0 comments on commit 51749ff

Please sign in to comment.