From e77cc2c264130d17cf43fc02113ec95b072c0ede Mon Sep 17 00:00:00 2001 From: Kasun Vithanage Date: Fri, 8 Mar 2024 23:06:13 +0530 Subject: [PATCH] fix: prettier --- src/@types/globals.ts | 6 +++--- src/App.vue | 20 ++++++++++++++++---- src/composables/useCodeClient.ts | 2 +- src/composables/useGsiScript.ts | 2 +- src/composables/useOneTap.ts | 8 ++++---- src/composables/useTokenClient.ts | 2 +- src/interfaces/accounts.ts | 2 +- src/plugin.ts | 2 +- src/utils/account.ts | 2 +- src/utils/oauth2.ts | 8 ++++---- 10 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/@types/globals.ts b/src/@types/globals.ts index cc98a28..e299643 100644 --- a/src/@types/globals.ts +++ b/src/@types/globals.ts @@ -23,12 +23,12 @@ declare global { renderButton: ( parent: HTMLElement, options: GsiButtonConfiguration, - clickHandler?: () => void + clickHandler?: () => void, ) => void; disableAutoSelect: () => void; storeCredential: ( credential: { id: string; password: string }, - callback?: () => void + callback?: () => void, ) => void; cancel: () => void; onGoogleLibraryLoad: () => void; @@ -37,7 +37,7 @@ declare global { oauth2: { initTokenClient: (config: TokenClientConfig) => { requestAccessToken: ( - overridableClientConfig?: OverridableTokenClientConfig + overridableClientConfig?: OverridableTokenClientConfig, ) => void; }; initCodeClient: (config: CodeClientConfig) => CodeClient; diff --git a/src/App.vue b/src/App.vue index f8a7ca9..826b0ff 100644 --- a/src/App.vue +++ b/src/App.vue @@ -29,7 +29,7 @@ const { isReady: isTokenClientReady, login: loginTokenClient } = useTokenClient( onSuccess: (resp) => console.log(resp), onError: (resp) => console.error(resp), prompt: "consent", - } + }, ); useOneTap({ @@ -138,10 +138,22 @@ body { min-height: 100vh; color: var(--color-text); background: var(--color-background); - transition: color 0.5s, background-color 0.5s; + transition: + color 0.5s, + background-color 0.5s; line-height: 1.6; - font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, - Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", + font-family: + Inter, + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + Roboto, + Oxygen, + Ubuntu, + Cantarell, + "Fira Sans", + "Droid Sans", + "Helvetica Neue", sans-serif; font-size: 15px; text-rendering: optimizeLegibility; diff --git a/src/composables/useCodeClient.ts b/src/composables/useCodeClient.ts index c6faa2e..27092e6 100644 --- a/src/composables/useCodeClient.ts +++ b/src/composables/useCodeClient.ts @@ -101,7 +101,7 @@ export interface UseCodeClientReturn { * @return {*} {UseCodeClientReturn} */ export default function useCodeClient( - options: ImplicitFlowOptions = {} + options: ImplicitFlowOptions = {}, ): UseCodeClientReturn { const { scope = "", onError, onSuccess, ...rest } = options; diff --git a/src/composables/useGsiScript.ts b/src/composables/useGsiScript.ts index bbc7d10..136e0f1 100644 --- a/src/composables/useGsiScript.ts +++ b/src/composables/useGsiScript.ts @@ -38,7 +38,7 @@ watch( if (newCount > 0 && !loaded.value && !isLoading.value) { initialize(); } - } + }, ); export type UseGsiScriptReturn = { diff --git a/src/composables/useOneTap.ts b/src/composables/useOneTap.ts index b4f00a4..de23408 100644 --- a/src/composables/useOneTap.ts +++ b/src/composables/useOneTap.ts @@ -30,7 +30,7 @@ export interface UseGoogleOneTapLoginOptions { * @memberof UseGoogleOneTapLoginOptions */ onPromptMomentNotification?: ( - promptMomentNotification: PromptMomentNotification + promptMomentNotification: PromptMomentNotification, ) => void; /** @@ -169,7 +169,7 @@ export interface UseOneTapResult { * @return {*} {UseOneTapResult} */ export default function useOneTap( - options?: UseGoogleOneTapLoginOptions + options?: UseGoogleOneTapLoginOptions, ): UseOneTapResult { const { disableAutomaticPrompt = false, @@ -196,7 +196,7 @@ export default function useOneTap( const login = () => isReady.value && window.google?.accounts.id.prompt((notification) => - onPromptMomentNotification?.(notification) + onPromptMomentNotification?.(notification), ); watchEffect((onCleanup) => { @@ -246,7 +246,7 @@ export default function useOneTap( if (shouldAutoLogin) { window.google?.accounts.id.prompt((notification) => - onPromptMomentNotification?.(notification) + onPromptMomentNotification?.(notification), ); } diff --git a/src/composables/useTokenClient.ts b/src/composables/useTokenClient.ts index 12024cb..4d0715f 100644 --- a/src/composables/useTokenClient.ts +++ b/src/composables/useTokenClient.ts @@ -92,7 +92,7 @@ export interface UseTokenClientReturn { * @return {*} {UseTokenClientReturn} */ export default function useTokenClient( - options: AuthCodeFlowOptions = {} + options: AuthCodeFlowOptions = {}, ): UseTokenClientReturn { const { scope = "", onError, onSuccess, ...rest } = options; diff --git a/src/interfaces/accounts.ts b/src/interfaces/accounts.ts index 63c8628..09a6725 100644 --- a/src/interfaces/accounts.ts +++ b/src/interfaces/accounts.ts @@ -392,7 +392,7 @@ export interface GsiButtonConfiguration { } export type MomentListener = ( - promptMomentNotification: PromptMomentNotification + promptMomentNotification: PromptMomentNotification, ) => void; export interface RevocationResponse { diff --git a/src/plugin.ts b/src/plugin.ts index 11a81e5..434b481 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -44,7 +44,7 @@ const plugin: Plugin = { install(app: App, options: GoogleSignInPluginOptions) { if (!options) { throw new Error( - toPluginError(`initialize plugin by passing an options object`) + toPluginError(`initialize plugin by passing an options object`), ); } diff --git a/src/utils/account.ts b/src/utils/account.ts index 363341e..3c4a959 100644 --- a/src/utils/account.ts +++ b/src/utils/account.ts @@ -29,7 +29,7 @@ export function decodeCredential(credential: string): DecodedGoogleUser { .atob(base64) .split("") .map((c) => `%${("00" + c.charCodeAt(0).toString(16)).slice(-2)}`) - .join("") + .join(""), ); const decodedToken = JSON.parse(jsonPayload); return { diff --git a/src/utils/oauth2.ts b/src/utils/oauth2.ts index 1a84102..7681ef5 100644 --- a/src/utils/oauth2.ts +++ b/src/utils/oauth2.ts @@ -18,7 +18,7 @@ export function hasGrantedAllScopes( window.google?.accounts.oauth2.hasGrantedAllScopes( tokenResponse, firstScope, - ...restScopes + ...restScopes, ) || false ); } @@ -41,7 +41,7 @@ export function hasGrantedAnyScopes( window.google?.accounts.oauth2.hasGrantedAnyScope( tokenResponse, firstScope, - ...restScopes + ...restScopes, ) || false ); } @@ -72,7 +72,7 @@ export type ImplicitFlowOptions = Omit< * @return {string} */ export function buildCodeRequestRedirectUrl( - options: ImplicitFlowOptions + options: ImplicitFlowOptions, ): string { const baseUrl = "https://accounts.google.com/o/oauth2/v2/auth"; @@ -106,7 +106,7 @@ export function buildCodeRequestRedirectUrl( } else { queryParams.append( "enable_serial_consent", - `${options.enable_serial_consent}` + `${options.enable_serial_consent}`, ); }