From 92ac295849f6cb2ff13d89c20656e48c6240d8b4 Mon Sep 17 00:00:00 2001 From: "D. Ror" Date: Wed, 24 Jan 2024 11:01:02 -0500 Subject: [PATCH] Fix import order by moving 'type' (#2894) --- .../MergeDuplicates/Redux/tests/MergeDupsDataMock.ts | 9 +++++---- src/store.ts | 3 +-- src/types/hooks.ts | 8 ++++++-- src/utilities/testUtilities.tsx | 10 ++++------ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts b/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts index 649d60392b..31ccccd983 100644 --- a/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts +++ b/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts @@ -1,13 +1,14 @@ -import type { PreloadedState } from "@reduxjs/toolkit"; -import { Definition, SemanticDomain, Word } from "api/models"; +import { type PreloadedState } from "@reduxjs/toolkit"; + +import { type Definition, type SemanticDomain, type Word } from "api/models"; import { defaultState } from "components/App/DefaultState"; import { convertSenseToMergeTreeSense, convertWordToMergeTreeWord, newMergeTreeWord, } from "goals/MergeDuplicates/MergeDupsTreeTypes"; -import { MergeDupsData } from "goals/MergeDuplicates/MergeDupsTypes"; -import { RootState } from "store"; +import { type MergeDupsData } from "goals/MergeDuplicates/MergeDupsTypes"; +import { type RootState } from "store"; import { newSense, newWord, simpleWord } from "types/word"; const wordsArrayMock = (): Word[] => [ diff --git a/src/store.ts b/src/store.ts index c635c57e6d..1ad229bd2d 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,8 +1,7 @@ -import { configureStore } from "@reduxjs/toolkit"; +import { type PreloadedState, configureStore } from "@reduxjs/toolkit"; import { persistStore, persistReducer } from "redux-persist"; import storage from "redux-persist/lib/storage"; -import type { PreloadedState } from "@reduxjs/toolkit"; import { rootReducer } from "rootReducer"; const persistConfig = { key: "root", storage }; diff --git a/src/types/hooks.ts b/src/types/hooks.ts index 091c66e1e3..9fc96b4d63 100644 --- a/src/types/hooks.ts +++ b/src/types/hooks.ts @@ -1,6 +1,10 @@ -import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux"; +import { + type TypedUseSelectorHook, + useDispatch, + useSelector, +} from "react-redux"; -import type { RootState, AppDispatch } from "store"; +import { type AppDispatch, type RootState } from "store"; // Use throughout your app instead of plain `useDispatch` and `useSelector` // `useAppDispatch` and `useAppSelector` apply the additional types for TypeScript diff --git a/src/utilities/testUtilities.tsx b/src/utilities/testUtilities.tsx index 825564203e..0f7020dcec 100644 --- a/src/utilities/testUtilities.tsx +++ b/src/utilities/testUtilities.tsx @@ -1,13 +1,11 @@ -import { render } from "@testing-library/react"; -import { PropsWithChildren, ReactElement } from "react"; +import { type PreloadedState } from "@reduxjs/toolkit"; +import { type RenderOptions, render } from "@testing-library/react"; +import { type PropsWithChildren, type ReactElement } from "react"; import { Provider } from "react-redux"; import { PersistGate } from "redux-persist/integration/react"; -import type { PreloadedState } from "@reduxjs/toolkit"; -import type { RenderOptions } from "@testing-library/react"; import { defaultState } from "components/App/DefaultState"; -import { persistor, setupStore } from "store"; -import type { AppStore, RootState } from "store"; +import { type AppStore, type RootState, persistor, setupStore } from "store"; // These test utilities are leveraged from the Redux documentation for Writing Tests: // https://redux.js.org/usage/writing-tests