From de0b0d01beddd748d8d4c92135aff1b2d68b5425 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 19 Dec 2024 20:46:58 -0500 Subject: [PATCH] fix --- .eslintrc.json | 11 +++++++++++ src/abacus-ts/ontology.ts | 1 + src/state/_store.ts | 14 ++++++-------- src/state/raw.ts | 1 + 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index f4c8b114f..482964e0d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -42,6 +42,17 @@ "no-multi-assign": "off", "no-nested-ternary": "off", "no-param-reassign": ["error", { "props": false }], + "no-restricted-imports": [ + "error", + { + "patterns": [ + "@/abacus-ts/*", + "!@/abacus-ts/ontology", + "!@/abacus-ts/lib", + "!@/abacus-ts/summaryTypes" + ] + } + ], "no-return-assign": "off", "no-return-await": "off", "no-underscore-dangle": "off", diff --git a/src/abacus-ts/ontology.ts b/src/abacus-ts/ontology.ts index 77da781d2..102584fb9 100644 --- a/src/abacus-ts/ontology.ts +++ b/src/abacus-ts/ontology.ts @@ -42,6 +42,7 @@ type NestedSelectors = { // all data should be accessed via selectrs in this file // no files outside abacus-ts should access anything within abacus-ts except this file +// TODO - enforce this via eslint export const MegalodonCore = { account: { parentSubaccountSummary: { diff --git a/src/state/_store.ts b/src/state/_store.ts index dc0ae05ef..aff5413df 100644 --- a/src/state/_store.ts +++ b/src/state/_store.ts @@ -1,3 +1,5 @@ +// eslint-disable-next-line no-restricted-imports +import { storeLifecycles } from '@/abacus-ts/storeLifecycles'; import { Middleware, combineReducers, configureStore } from '@reduxjs/toolkit'; import { persistReducer, persistStore } from 'redux-persist'; import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2'; @@ -5,7 +7,6 @@ import storage from 'redux-persist/lib/storage'; import abacusStateManager from '@/lib/abacus'; import { runFn } from '@/lib/do'; -import { testFlags } from '@/lib/testFlags'; import { accountSlice } from './account'; import { accountUiMemorySlice } from './accountUiMemory'; @@ -98,13 +99,10 @@ export const persistor = persistStore(store); // Set store so (Abacus & v4-Client) classes can getState and dispatch abacusStateManager.setStore(store); -if (testFlags.useAbacusTs) { - runFn(async () => { - const { storeLifecycles } = await import('@/abacus-ts/storeLifecycles'); - // we ignore the cleanups for now since we want these running forever - storeLifecycles.forEach((fn) => fn(store)); - }); -} +runFn(async () => { + // we ignore the cleanups for now since we want these running forever + storeLifecycles.forEach((fn) => fn(store)); +}); export type RootStore = typeof store; export type RootState = ReturnType; diff --git a/src/state/raw.ts b/src/state/raw.ts index 2132af23a..1492ab57d 100644 --- a/src/state/raw.ts +++ b/src/state/raw.ts @@ -1,4 +1,5 @@ import { Loadable, loadableIdle } from '@/abacus-ts/lib/loadable'; +// eslint-disable-next-line no-restricted-imports import { AssetInfos, MarketsData,