From 6390583ec3bddfc9bfec8deb6e4dd8bace19dd8a Mon Sep 17 00:00:00 2001 From: Jcanotorr06 Date: Tue, 20 Dec 2022 18:50:14 -0500 Subject: [PATCH] refactor: correct eslint warnings --- src/components/Alerts/AlertManager.tsx | 6 +++--- src/components/Email/Address.tsx | 8 ++++---- src/components/Email/Inbox.tsx | 14 ++++++-------- src/components/Email/Message.tsx | 6 +++--- src/components/Email/MessageDetails.tsx | 16 ++++++++-------- src/components/Email/index.ts | 8 ++++---- src/components/Landing/ToolCard.tsx | 4 ++-- src/components/Landing/index.ts | 2 +- src/components/Layouts/BaseLayout.tsx | 2 +- src/components/Modals/ModalManager.tsx | 10 +++++----- src/components/Modals/SearchModal.tsx | 2 +- src/components/Navigation/Sidebar.tsx | 2 +- src/components/utils/Loading.tsx | 4 ++-- src/pages/_app.tsx | 2 -- src/queries/email.ts | 1 - src/state/alertStore.ts | 8 ++++---- src/state/emailStore.ts | 6 +++--- src/state/index.ts | 2 +- src/state/modalStore.ts | 10 +++++----- src/state/sidebarStore.ts | 4 ++-- 20 files changed, 56 insertions(+), 61 deletions(-) diff --git a/src/components/Alerts/AlertManager.tsx b/src/components/Alerts/AlertManager.tsx index ddb7afb..6790242 100644 --- a/src/components/Alerts/AlertManager.tsx +++ b/src/components/Alerts/AlertManager.tsx @@ -1,6 +1,6 @@ -import { AnimatePresence, motion } from 'framer-motion'; -import { FaTimes } from 'react-icons/fa'; -import useAlertStore from './../../state/alertStore'; +import { AnimatePresence, motion } from "framer-motion"; +import { FaTimes } from "react-icons/fa"; +import useAlertStore from "./../../state/alertStore"; const AlertManager = () => { const { isAlertOpen, closeAlert, alertText, alertType } = useAlertStore() diff --git a/src/components/Email/Address.tsx b/src/components/Email/Address.tsx index 5a03d4c..734afbe 100644 --- a/src/components/Email/Address.tsx +++ b/src/components/Email/Address.tsx @@ -1,8 +1,8 @@ -import { type FC, Fragment } from 'react' -import { useQuery } from '@tanstack/react-query' +import { type FC, Fragment } from "react" +import { useQuery } from "@tanstack/react-query" import { FaCopy } from "react-icons/fa" -import { getEmailAddress } from '../../queries/email' -import useAlertStore from '../../state/alertStore' +import { getEmailAddress } from "../../queries/email" +import useAlertStore from "../../state/alertStore" const Address:FC = () => { diff --git a/src/components/Email/Inbox.tsx b/src/components/Email/Inbox.tsx index ed97edf..19a85b1 100644 --- a/src/components/Email/Inbox.tsx +++ b/src/components/Email/Inbox.tsx @@ -1,11 +1,9 @@ -import { type FC, Fragment } from 'react' -import { useQuery } from '@tanstack/react-query' -import { getEmailAddress, getMailbox } from '../../queries/email' -import Loading from '../utils/Loading' -import { HiEnvelopeOpen } from 'react-icons/hi2' -import * as dayjs from "dayjs" -import Message from './Message' -import useEmailStore from '../../state/emailStore' +import { type FC, Fragment } from "react" +import { useQuery } from "@tanstack/react-query" +import { getEmailAddress, getMailbox } from "../../queries/email" +import Loading from "../utils/Loading" +import { HiEnvelopeOpen } from "react-icons/hi2" +import Message from "./Message" const Inbox:FC = () => { diff --git a/src/components/Email/Message.tsx b/src/components/Email/Message.tsx index dbb3401..acb7888 100644 --- a/src/components/Email/Message.tsx +++ b/src/components/Email/Message.tsx @@ -1,7 +1,7 @@ -import type { FC } from 'react' -import type { Mailbox } from '../../types/mailbox' +import type { FC } from "react" +import type { Mailbox } from "../../types/mailbox" import * as dayjs from "dayjs" -import useEmailStore from '../../state/emailStore' +import useEmailStore from "../../state/emailStore" type Props = { email: Mailbox diff --git a/src/components/Email/MessageDetails.tsx b/src/components/Email/MessageDetails.tsx index 4972b0c..5f2effb 100644 --- a/src/components/Email/MessageDetails.tsx +++ b/src/components/Email/MessageDetails.tsx @@ -1,12 +1,12 @@ -import { useQuery } from '@tanstack/react-query' -import { Interweave } from 'interweave' -import { type FC } from 'react' -import { FaFile, FaFileDownload, FaTimes } from 'react-icons/fa' +import { useQuery } from "@tanstack/react-query" +import { Interweave } from "interweave" +import { type FC } from "react" +import { FaFileDownload, FaTimes } from "react-icons/fa" import * as dayjs from "dayjs" -import { getEmailAddress, getMailboxMessage } from '../../queries/email' -import useEmailStore from '../../state/emailStore' -import Loading from '../utils/Loading' -import type { Mailbox, MailboxMessageAttachment } from '../../types/mailbox' +import { getEmailAddress, getMailboxMessage } from "../../queries/email" +import useEmailStore from "../../state/emailStore" +import Loading from "../utils/Loading" +import type { Mailbox, MailboxMessageAttachment } from "../../types/mailbox" const MessageDetails:FC = () => { const { email, closeEmail } = useEmailStore() diff --git a/src/components/Email/index.ts b/src/components/Email/index.ts index 29176a2..07b6911 100644 --- a/src/components/Email/index.ts +++ b/src/components/Email/index.ts @@ -1,4 +1,4 @@ -export { default as Address } from './Address'; -export { default as Inbox } from './Inbox'; -export { default as Message } from './Message'; -export { default as MessageDetails } from './MessageDetails'; \ No newline at end of file +export { default as Address } from "./Address"; +export { default as Inbox } from "./Inbox"; +export { default as Message } from "./Message"; +export { default as MessageDetails } from "./MessageDetails"; \ No newline at end of file diff --git a/src/components/Landing/ToolCard.tsx b/src/components/Landing/ToolCard.tsx index 994c382..4a3b62a 100644 --- a/src/components/Landing/ToolCard.tsx +++ b/src/components/Landing/ToolCard.tsx @@ -1,5 +1,5 @@ -import { type FC } from 'react' -import Link from 'next/link' +import { type FC } from "react" +import Link from "next/link" type Props = { name: string, diff --git a/src/components/Landing/index.ts b/src/components/Landing/index.ts index cf498ca..10ed12d 100644 --- a/src/components/Landing/index.ts +++ b/src/components/Landing/index.ts @@ -1 +1 @@ -export { default as ToolCard } from './ToolCard'; \ No newline at end of file +export { default as ToolCard } from "./ToolCard"; \ No newline at end of file diff --git a/src/components/Layouts/BaseLayout.tsx b/src/components/Layouts/BaseLayout.tsx index 226ce55..e853f0c 100644 --- a/src/components/Layouts/BaseLayout.tsx +++ b/src/components/Layouts/BaseLayout.tsx @@ -26,7 +26,7 @@ const BaseLayout:FC = ({children}:Props) => { } variants={variants} initial={false} - className={`flex flex-grow bg-base-200 z-10 h-full p-4`} + className={"flex flex-grow bg-base-200 z-10 h-full p-4"} > {children} diff --git a/src/components/Modals/ModalManager.tsx b/src/components/Modals/ModalManager.tsx index 9755967..eb969cb 100644 --- a/src/components/Modals/ModalManager.tsx +++ b/src/components/Modals/ModalManager.tsx @@ -1,10 +1,10 @@ -import { AnimatePresence, motion } from 'framer-motion' -import React, { lazy } from 'react' +import { AnimatePresence, motion } from "framer-motion" +import React, { lazy } from "react" import { FaTimes } from "react-icons/fa" -import useModalStore from '../../state/modalStore' -import LazyLoading from '../utils/LazyLoading' +import useModalStore from "../../state/modalStore" +import LazyLoading from "../utils/LazyLoading" -const SearchModal = lazy(() => import('./SearchModal')) +const SearchModal = lazy(() => import("./SearchModal")) export type ModalTypes = "search" | "alert" | "" diff --git a/src/components/Modals/SearchModal.tsx b/src/components/Modals/SearchModal.tsx index b50a7c2..4ae94cb 100644 --- a/src/components/Modals/SearchModal.tsx +++ b/src/components/Modals/SearchModal.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React from "react" const SearchModal = () => { return ( diff --git a/src/components/Navigation/Sidebar.tsx b/src/components/Navigation/Sidebar.tsx index 7b0b57f..ad4a146 100644 --- a/src/components/Navigation/Sidebar.tsx +++ b/src/components/Navigation/Sidebar.tsx @@ -1,7 +1,7 @@ import { type FC , useEffect } from "react" import { AnimatePresence, motion } from "framer-motion" import { useSidebarStore } from "../../state" -import { HiMoon, HiSun, HiHome, HiEnvelope, HiMagnifyingGlass, HiChevronLeft, HiChevronRight } from 'react-icons/hi2'; +import { HiMoon, HiSun, HiHome, HiEnvelope, HiMagnifyingGlass, HiChevronLeft, HiChevronRight } from "react-icons/hi2"; import { BsFileTextFill } from "react-icons/bs" import { themeChange } from "theme-change"; import Link from "next/link"; diff --git a/src/components/utils/Loading.tsx b/src/components/utils/Loading.tsx index 83e9fc9..a74609b 100644 --- a/src/components/utils/Loading.tsx +++ b/src/components/utils/Loading.tsx @@ -1,5 +1,5 @@ -import { type FC } from 'react' -import { Oval } from 'react-loader-spinner' +import { type FC } from "react" +import { Oval } from "react-loader-spinner" const Loading:FC = () => { return ( diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index c673845..80f31f6 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,11 +1,9 @@ import { DefaultSeo } from "next-seo"; import { type AppType } from "next/dist/shared/lib/utils"; -import { Fragment, useEffect } from "react"; import BaseLayout from "../components/Layouts/BaseLayout"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import "../styles/globals.css"; -import { themeChange } from "theme-change"; const queryClient = new QueryClient({ /* defaultOptions: { diff --git a/src/queries/email.ts b/src/queries/email.ts index c213888..857fddc 100644 --- a/src/queries/email.ts +++ b/src/queries/email.ts @@ -1,6 +1,5 @@ import { type QueryFunction } from "@tanstack/react-query"; import type { Mailbox, MailboxMessage } from "../types/mailbox"; -import { getDecodedLocalStorage, setEncodedLocalStorage } from './../utils/storage'; const url = "https://www.1secmail.com/api/v1/" diff --git a/src/state/alertStore.ts b/src/state/alertStore.ts index ef7fe87..4792c2a 100644 --- a/src/state/alertStore.ts +++ b/src/state/alertStore.ts @@ -1,5 +1,5 @@ -import create from 'zustand'; -import { devtools } from 'zustand/middleware'; +import create from "zustand"; +import { devtools } from "zustand/middleware"; type Alert = "info" | "success" | "warning" | "error" @@ -15,10 +15,10 @@ const useAlertStore = create()( devtools( (set) => ({ isAlertOpen: false, - alertText: '', + alertText: "", alertType: "info", openAlert: (text: string, type: Alert) => set(() => ({ isAlertOpen: true, alertText: text, alertType: type })), - closeAlert: () => set(() => ({ isAlertOpen: false, alertText: '', alertType: "info" })), + closeAlert: () => set(() => ({ isAlertOpen: false, alertText: "", alertType: "info" })), }) ) ) diff --git a/src/state/emailStore.ts b/src/state/emailStore.ts index d03045c..3ec6923 100644 --- a/src/state/emailStore.ts +++ b/src/state/emailStore.ts @@ -1,6 +1,6 @@ -import create from 'zustand'; -import { devtools } from 'zustand/middleware'; -import type { Mailbox } from '../types/mailbox'; +import create from "zustand"; +import { devtools } from "zustand/middleware"; +import type { Mailbox } from "../types/mailbox"; type EmailStore = { email: Mailbox | null; diff --git a/src/state/index.ts b/src/state/index.ts index a259619..f3a67ff 100644 --- a/src/state/index.ts +++ b/src/state/index.ts @@ -1 +1 @@ -export { default as useSidebarStore } from './sidebarStore'; \ No newline at end of file +export { default as useSidebarStore } from "./sidebarStore"; \ No newline at end of file diff --git a/src/state/modalStore.ts b/src/state/modalStore.ts index 5c9ca4d..f1cf325 100644 --- a/src/state/modalStore.ts +++ b/src/state/modalStore.ts @@ -1,6 +1,6 @@ -import create from 'zustand'; -import { devtools } from 'zustand/middleware'; -import type { ModalTypes } from '../components/Modals/ModalManager'; +import create from "zustand"; +import { devtools } from "zustand/middleware"; +import type { ModalTypes } from "../components/Modals/ModalManager"; type ModalStore = { isModalOpen: boolean; @@ -13,9 +13,9 @@ const useModalStore = create()( devtools( (set) => ({ isModalOpen: false, - modalId: '', + modalId: "", openModal: (id: ModalTypes) => set(() => ({ isModalOpen: true, modalId: id })), - closeModal: () => set(() => ({ isModalOpen: false, modalId: '' })), + closeModal: () => set(() => ({ isModalOpen: false, modalId: "" })), }) ) ) diff --git a/src/state/sidebarStore.ts b/src/state/sidebarStore.ts index 2f99c55..e6cfa50 100644 --- a/src/state/sidebarStore.ts +++ b/src/state/sidebarStore.ts @@ -1,5 +1,5 @@ -import create from 'zustand'; -import { devtools } from 'zustand/middleware'; +import create from "zustand"; +import { devtools } from "zustand/middleware"; type SidebarStore = { isSidebarOpen: boolean;