chore: finish frontend ESLint migration #18
Enable every plugin recommended preset and replace Biome with ESLint formatting. Preserve API contracts and JSX whitespace; verify source, tests, builds and tooling.
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import type { QueryClient } from "@tanstack/react-query";
|
||||
|
||||
import {
|
||||
apiQueryClient,
|
||||
invalidateApiRequests,
|
||||
type paths,
|
||||
} from "@/shared/api";
|
||||
|
||||
type TbankConnectionStatus =
|
||||
paths["/api/v1/tbank-connection"]["get"]["responses"][200]["content"]["application/json"];
|
||||
type TbankConnectionStatus
|
||||
= paths["/api/v1/tbank-connection"]["get"]["responses"][200]["content"]["application/json"];
|
||||
|
||||
const brokerageAccountsPath = "/api/v1/brokerage-accounts";
|
||||
|
||||
@@ -20,26 +21,26 @@ function commitTbankConnectionBoundary(
|
||||
status: TbankConnectionStatus,
|
||||
) {
|
||||
invalidateApiRequests(
|
||||
(path) =>
|
||||
path.startsWith("/api/v1/brokerage-accounts") ||
|
||||
path.startsWith("/api/v1/stocks") ||
|
||||
path.startsWith("/api/v1/bonds") ||
|
||||
path.startsWith("/api/v1/tbank-sync"),
|
||||
path =>
|
||||
path.startsWith("/api/v1/brokerage-accounts")
|
||||
|| path.startsWith("/api/v1/stocks")
|
||||
|| path.startsWith("/api/v1/bonds")
|
||||
|| path.startsWith("/api/v1/tbank-sync"),
|
||||
);
|
||||
queryClient.setQueryData(tbankConnectionQueryKey, status);
|
||||
void queryClient.resetQueries({
|
||||
predicate: ({ queryKey }) => {
|
||||
const [method, path] = queryKey;
|
||||
return (
|
||||
method === "get" &&
|
||||
typeof path === "string" &&
|
||||
(path.startsWith("/api/v1/tbank-sync") ||
|
||||
path === "/api/v1/bonds" ||
|
||||
path.startsWith("/api/v1/bonds/") ||
|
||||
path === "/api/v1/stocks" ||
|
||||
path.startsWith("/api/v1/stocks/") ||
|
||||
path === brokerageAccountsPath ||
|
||||
path.startsWith(`${brokerageAccountsPath}/`))
|
||||
method === "get"
|
||||
&& typeof path === "string"
|
||||
&& (path.startsWith("/api/v1/tbank-sync")
|
||||
|| path === "/api/v1/bonds"
|
||||
|| path.startsWith("/api/v1/bonds/")
|
||||
|| path === "/api/v1/stocks"
|
||||
|| path.startsWith("/api/v1/stocks/")
|
||||
|| path === brokerageAccountsPath
|
||||
|| path.startsWith(`${brokerageAccountsPath}/`))
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -47,6 +48,6 @@ function commitTbankConnectionBoundary(
|
||||
|
||||
export {
|
||||
commitTbankConnectionBoundary,
|
||||
type TbankConnectionStatus,
|
||||
tbankConnectionQueryOptions,
|
||||
type TbankConnectionStatus,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user