feat: Replace eslint => oxlint + oxfmt
This commit is contained in:
@@ -6,7 +6,7 @@ export function useAuthConnexion() {
|
||||
const { isLoggedIn } = useAuth();
|
||||
const toast = useToast();
|
||||
const { fetch: refreshUserSession } = useUserSession();
|
||||
const routeRedirect = useRoute().query.redirect as string || undefined;
|
||||
const routeRedirect = (useRoute().query.redirect as string) || undefined;
|
||||
|
||||
// Helper: Redirect after login / logout
|
||||
async function redirectTo(to: string | undefined) {
|
||||
@@ -30,13 +30,13 @@ export function useAuthConnexion() {
|
||||
duration: 3000,
|
||||
});
|
||||
await redirectTo(redirect);
|
||||
}
|
||||
catch (error) {
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
toast.add({
|
||||
title: "Erreur de connexion",
|
||||
color: "error",
|
||||
description: error instanceof Error ? error.message : "Une erreur est survenue lors de la connexion.",
|
||||
description:
|
||||
error instanceof Error ? error.message : "Une erreur est survenue lors de la connexion.",
|
||||
duration: 5000,
|
||||
});
|
||||
}
|
||||
@@ -56,13 +56,15 @@ export function useAuthConnexion() {
|
||||
duration: 3000,
|
||||
});
|
||||
await redirectTo(redirect);
|
||||
}
|
||||
catch (error) {
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
toast.add({
|
||||
title: "Erreur de déconnexion",
|
||||
color: "error",
|
||||
description: error instanceof Error ? error.message : "Une erreur est survenue lors de la déconnexion.",
|
||||
description:
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: "Une erreur est survenue lors de la déconnexion.",
|
||||
duration: 5000,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
export const useGeneralSettings = () => useAsyncGraphQLQuery("GeneralSettings", {}, {
|
||||
transform: ({ generalSettings }) => generalSettings,
|
||||
});
|
||||
export const useGeneralSettings = () =>
|
||||
useAsyncGraphQLQuery(
|
||||
"GeneralSettings",
|
||||
{},
|
||||
{
|
||||
transform: ({ generalSettings }) => generalSettings,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -11,8 +11,7 @@ export function useProseLinks(refContent: Ref<HTMLElement | null>) {
|
||||
try {
|
||||
const hrefUrl = new URL(href);
|
||||
return hrefUrl.hostname === siteUrl.hostname;
|
||||
}
|
||||
catch {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -25,8 +24,7 @@ export function useProseLinks(refContent: Ref<HTMLElement | null>) {
|
||||
if (hrefUrl.hostname === siteUrl.hostname) {
|
||||
return hrefUrl.pathname + hrefUrl.search + hrefUrl.hash;
|
||||
}
|
||||
}
|
||||
catch {
|
||||
} catch {
|
||||
// Invalid URL
|
||||
}
|
||||
return href;
|
||||
@@ -39,7 +37,14 @@ export function useProseLinks(refContent: Ref<HTMLElement | null>) {
|
||||
if (!link) return;
|
||||
const href = link.getAttribute("href");
|
||||
if (!href) return;
|
||||
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || link.target === "_blank" || link.hasAttribute("download")) {
|
||||
if (
|
||||
e.metaKey ||
|
||||
e.ctrlKey ||
|
||||
e.shiftKey ||
|
||||
e.altKey ||
|
||||
link.target === "_blank" ||
|
||||
link.hasAttribute("download")
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (isInternal(href)) {
|
||||
|
||||
@@ -2,7 +2,9 @@ import { breakpointsTailwind, useBreakpoints } from "@vueuse/core";
|
||||
|
||||
export function useResponsive() {
|
||||
const { isMobileOrTablet } = useDevice();
|
||||
const breakpoints = useBreakpoints(breakpointsTailwind, { ssrWidth: isMobileOrTablet ? 375 : 1024 });
|
||||
const breakpoints = useBreakpoints(breakpointsTailwind, {
|
||||
ssrWidth: isMobileOrTablet ? 375 : 1024,
|
||||
});
|
||||
const isDesktop = breakpoints.greaterOrEqual("lg");
|
||||
|
||||
return { breakpoints, isDesktop };
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
export const useSiteOptions = () => useAsyncGraphQLQuery("SiteOptions", {}, {
|
||||
transform: ({ siteOptions }) => siteOptions?.groupSiteOptions,
|
||||
});
|
||||
export const useSiteOptions = () =>
|
||||
useAsyncGraphQLQuery(
|
||||
"SiteOptions",
|
||||
{},
|
||||
{
|
||||
transform: ({ siteOptions }) => siteOptions?.groupSiteOptions,
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user