mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 08:14:06 +00:00
Add eslint rule and fix as many issues as possible
This commit is contained in:
+22
-22
@@ -4,36 +4,36 @@
|
||||
/* eslint-disable react/jsx-props-no-spreading */
|
||||
// @ts-nocheck
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { AppProps } from 'next/app';
|
||||
import { useRouter } from 'next/router';
|
||||
import { config } from '@fortawesome/fontawesome-svg-core';
|
||||
import { QueryClientProvider } from '@tanstack/react-query';
|
||||
import { useEffect } from "react";
|
||||
import { AppProps } from "next/app";
|
||||
import { useRouter } from "next/router";
|
||||
import { config } from "@fortawesome/fontawesome-svg-core";
|
||||
import { QueryClientProvider } from "@tanstack/react-query";
|
||||
|
||||
import NotificationProvider from '@app/components/context/Notifications/NotificationProvider';
|
||||
import { IntercomProvider } from '@app/components/utilities/intercom/intercomProvider';
|
||||
import Telemetry from '@app/components/utilities/telemetry/Telemetry';
|
||||
import { TooltipProvider } from '@app/components/v2';
|
||||
import { publicPaths } from '@app/const';
|
||||
import NotificationProvider from "@app/components/context/Notifications/NotificationProvider";
|
||||
import { IntercomProvider } from "@app/components/utilities/intercom/intercomProvider";
|
||||
import Telemetry from "@app/components/utilities/telemetry/Telemetry";
|
||||
import { TooltipProvider } from "@app/components/v2";
|
||||
import { publicPaths } from "@app/const";
|
||||
import {
|
||||
AuthProvider,
|
||||
OrgProvider,
|
||||
SubscriptionProvider,
|
||||
UserProvider,
|
||||
WorkspaceProvider
|
||||
} from '@app/context';
|
||||
import { AppLayout } from '@app/layouts';
|
||||
import { queryClient } from '@app/reactQuery';
|
||||
} from "@app/context";
|
||||
import { AppLayout } from "@app/layouts";
|
||||
import { queryClient } from "@app/reactQuery";
|
||||
|
||||
import '@fortawesome/fontawesome-svg-core/styles.css';
|
||||
import '../styles/globals.css';
|
||||
import "@fortawesome/fontawesome-svg-core/styles.css";
|
||||
import "../styles/globals.css";
|
||||
|
||||
import '@app/i18n';
|
||||
import "@app/i18n";
|
||||
|
||||
config.autoAddCss = false;
|
||||
|
||||
type NextAppProp = AppProps & {
|
||||
Component: AppProps['Component'] & { requireAuth: boolean };
|
||||
Component: AppProps["Component"] & { requireAuth: boolean };
|
||||
};
|
||||
|
||||
const App = ({ Component, pageProps, ...appProps }: NextAppProp): JSX.Element => {
|
||||
@@ -45,21 +45,21 @@ const App = ({ Component, pageProps, ...appProps }: NextAppProp): JSX.Element =>
|
||||
|
||||
const handleRouteChange = () => {
|
||||
// (window).Intercom('update');
|
||||
if (typeof window !== 'undefined') {
|
||||
telemetry.capture('$pageview');
|
||||
if (typeof window !== "undefined") {
|
||||
telemetry.capture("$pageview");
|
||||
}
|
||||
};
|
||||
|
||||
router.events.on('routeChangeComplete', handleRouteChange);
|
||||
router.events.on("routeChangeComplete", handleRouteChange);
|
||||
|
||||
return () => {
|
||||
router.events.off('routeChangeComplete', handleRouteChange);
|
||||
router.events.off("routeChangeComplete", handleRouteChange);
|
||||
};
|
||||
}, [router.events]);
|
||||
|
||||
// If it's one of these routes, don't add the layout (e.g., these routes are external)
|
||||
if (
|
||||
publicPaths.includes(`/${appProps.router.pathname.split('/')[1]}`) ||
|
||||
publicPaths.includes(`/${appProps.router.pathname.split("/")[1]}`) ||
|
||||
!Component.requireAuth
|
||||
) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user