fix: lint

This commit is contained in:
kawamataryo
2024-10-17 23:02:15 +09:00
parent 98a6f0fea3
commit 1bd4b07c38
8 changed files with 104 additions and 14238 deletions

View File

@@ -1,3 +1,4 @@
import cssText from "data-text:~style.content.css";
import type { PlasmoCSConfig } from "plasmo";
import React from "react";
import AlertError from "~lib/components/AlertError";
@@ -8,7 +9,6 @@ import UserCard from "~lib/components/UserCard";
import UserCardSkeleton from "~lib/components/UserCardSkeleton";
import { MESSAGE_NAMES } from "~lib/constants";
import { useRetrieveBskyUsers } from "~lib/hooks/useRetrieveBskyUsers";
import cssText from "data-text:~style.content.css";
export const config: PlasmoCSConfig = {
matches: ["https://twitter.com/*", "https://x.com/*"],

View File

@@ -1,7 +1,7 @@
import { AtUri, type AtpSessionData, AtpAgent } from "@atproto/api";
import { AtUri, AtpAgent, type AtpSessionData } from "@atproto/api";
// try and cut down the amount of session resumes by caching the clients
const clientCache = new Map<string, BskyClient>()
const clientCache = new Map<string, BskyClient>();
export type BskyLoginParams = {
identifier: string;
@@ -29,20 +29,19 @@ export class BskyClient {
public static createAgentFromSession(session: AtpSessionData): BskyClient {
if (clientCache.has(session.did)) {
return clientCache.get(session.did)
} else {
const client = new BskyClient();
client.agent.resumeSession(session);
client.me = {
did: session.did,
handle: session.handle,
email: session.email,
};
clientCache.set(session.did, client);
return client;
return clientCache.get(session.did);
}
const client = new BskyClient();
client.agent.resumeSession(session);
client.me = {
did: session.did,
handle: session.handle,
email: session.email,
};
clientCache.set(session.did, client);
return client;
}
public static async createAgent({

View File

@@ -1,4 +1,4 @@
import React from "react";
import type React from "react";
export type Props = {
children: React.ReactNode;

View File

@@ -3,7 +3,7 @@ import { BskyServiceWorkerClient } from "~lib/bskyServiceWorkerClient";
import {
ACTION_MODE,
BSKY_USER_MATCH_TYPE,
MESSAGE_NAMES,
type MESSAGE_NAMES,
MESSAGE_NAME_TO_ACTION_MODE_MAP,
MESSAGE_NAME_TO_QUERY_PARAM_MAP,
} from "~lib/constants";
@@ -222,6 +222,7 @@ export const useRetrieveBskyUsers = () => {
setLoading(true);
showModal();
},
// biome-ignore lint/correctness/useExhaustiveDependencies: todo
[startRetrieveLoop, showModal],
);
@@ -257,7 +258,7 @@ export const useRetrieveBskyUsers = () => {
[],
);
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
// biome-ignore lint/correctness/useExhaustiveDependencies: todo
const filteredUsers = React.useMemo(() => {
return users.filter((user) => {
return matchTypeFilter[user.matchType];

View File

@@ -1,5 +1,5 @@
import { isSimilarUser } from "~lib/bskyHelpers";
import { getAccountNameAndDisplayName } from "~lib/domHelpers";
import type { getAccountNameAndDisplayName } from "~lib/domHelpers";
import { isOneSymbol } from "~lib/utils";
import type { BskyServiceWorkerClient } from "./bskyServiceWorkerClient";