mirror of
https://github.com/nonebot/nonebot2.git
synced 2026-07-25 17:52:39 +00:00
🎨 replace prettier with oxfmt
This commit is contained in:
@@ -38,7 +38,7 @@ export default function AdapterForm(): React.ReactNode {
|
||||
template: "adapter_publish.yml",
|
||||
title: `Adapter: ${result.name}`,
|
||||
...result,
|
||||
})}`
|
||||
})}`,
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ export default function BotForm(): React.ReactNode {
|
||||
template: "bot_publish.yml",
|
||||
title: `Bot: ${result.name}`,
|
||||
...result,
|
||||
})}`
|
||||
})}`,
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ export default function TagFormItem({
|
||||
new Set(
|
||||
allowTags
|
||||
.filter((tag) => tag.label.toLocaleLowerCase().includes(label))
|
||||
.map((e) => e.label)
|
||||
)
|
||||
.map((e) => e.label),
|
||||
),
|
||||
).slice(0, 5);
|
||||
|
||||
const validateTag = () => {
|
||||
|
||||
@@ -24,7 +24,7 @@ export default function PluginForm(): React.ReactNode {
|
||||
template: "plugin_publish.yml",
|
||||
title: `Plugin: ${result.pypi}`,
|
||||
...result,
|
||||
})}`
|
||||
})}`,
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ export function Form({
|
||||
data
|
||||
.filter((item) => item.tags.length > 0)
|
||||
.map((ele) => ele.tags)
|
||||
.flat()
|
||||
)
|
||||
.flat(),
|
||||
),
|
||||
)
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
@@ -63,7 +63,7 @@ export function Form({
|
||||
|
||||
const handleNextStep = () => {
|
||||
const currentStepNames = formItems[currentStep].items.map(
|
||||
(item) => item.name
|
||||
(item) => item.name,
|
||||
);
|
||||
if (currentStepNames.every((name) => result[name])) {
|
||||
setCurrentStep(currentStep + 1);
|
||||
|
||||
@@ -37,7 +37,7 @@ function MessageBox({
|
||||
<div
|
||||
className={clsx(
|
||||
"messenger-chat-avatar",
|
||||
isRight && "messenger-chat-avatar-user"
|
||||
isRight && "messenger-chat-avatar-user",
|
||||
)}
|
||||
>
|
||||
{isRight ? (
|
||||
@@ -50,7 +50,7 @@ function MessageBox({
|
||||
<div
|
||||
className={clsx(
|
||||
"chat-bubble messenger-chat-bubble",
|
||||
monospace && "font-mono"
|
||||
monospace && "font-mono",
|
||||
)}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: msg.replace(/\n/g, "<br/>").replace(/ /g, " "),
|
||||
|
||||
@@ -110,7 +110,7 @@ export default function Paginate({
|
||||
className={clsx(
|
||||
"paginate-button",
|
||||
typeof page !== "number" && "ellipsis",
|
||||
currentPage === page && "active"
|
||||
currentPage === page && "active",
|
||||
)}
|
||||
onClick={() =>
|
||||
typeof page === "number" &&
|
||||
|
||||
@@ -21,7 +21,7 @@ export default function Avatar({ authorLink, authorAvatar, className }: Props) {
|
||||
<div
|
||||
className={clsx(
|
||||
"absolute inset-0 rounded-full bg-gray-200",
|
||||
"animate-pulse"
|
||||
"animate-pulse",
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
@@ -31,7 +31,7 @@ export default function Avatar({ authorLink, authorAvatar, className }: Props) {
|
||||
className={clsx(
|
||||
"w-full h-full rounded-full object-cover",
|
||||
"transition-opacity duration-300",
|
||||
loaded ? "opacity-100" : "opacity-0"
|
||||
loaded ? "opacity-100" : "opacity-0",
|
||||
)}
|
||||
alt="Avatar"
|
||||
/>
|
||||
|
||||
@@ -28,7 +28,7 @@ export default function ResourceCard({
|
||||
className,
|
||||
}: Props): React.ReactNode {
|
||||
const isGithub = /^https:\/\/github.com\/[^/]+\/[^/]+/.test(
|
||||
resource.homepage
|
||||
resource.homepage,
|
||||
);
|
||||
|
||||
const isPlugin = resource.resourceType === "plugin";
|
||||
|
||||
@@ -180,7 +180,7 @@ export default function ResourceDetailCard({ resource }: Props) {
|
||||
`${
|
||||
pypiData.releases[pypiData.info.version].reduce(
|
||||
(acc, curr) => acc + curr.size,
|
||||
0
|
||||
0,
|
||||
) / 1000
|
||||
}K`) ||
|
||||
"无"}
|
||||
|
||||
@@ -88,14 +88,14 @@ export default function AdapterPage(): React.ReactNode {
|
||||
(tag: string) => {
|
||||
addFilter(tagFilter(tag));
|
||||
},
|
||||
[addFilter]
|
||||
[addFilter],
|
||||
);
|
||||
|
||||
const onCardAuthorClick = useCallback(
|
||||
(author: string) => {
|
||||
addFilter(authorFilter(author));
|
||||
},
|
||||
[addFilter]
|
||||
[addFilter],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -80,14 +80,14 @@ export default function PluginPage(): React.ReactNode {
|
||||
(tag: string) => {
|
||||
addFilter(tagFilter(tag));
|
||||
},
|
||||
[addFilter]
|
||||
[addFilter],
|
||||
);
|
||||
|
||||
const onAuthorClick = useCallback(
|
||||
(author: string) => {
|
||||
addFilter(authorFilter(author));
|
||||
},
|
||||
[addFilter]
|
||||
[addFilter],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -71,14 +71,14 @@ export default function DriverPage(): React.ReactNode {
|
||||
(tag: string) => {
|
||||
addFilter(tagFilter(tag));
|
||||
},
|
||||
[addFilter]
|
||||
[addFilter],
|
||||
);
|
||||
|
||||
const onAuthorClick = useCallback(
|
||||
(author: string) => {
|
||||
addFilter(authorFilter(author));
|
||||
},
|
||||
[addFilter]
|
||||
[addFilter],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -50,7 +50,7 @@ export default function PluginPage(): React.ReactNode {
|
||||
active: sortMode === SortMode.UpdateDesc,
|
||||
onClick: () => {
|
||||
setSortMode(
|
||||
sortMode === SortMode.Default ? SortMode.UpdateDesc : SortMode.Default
|
||||
sortMode === SortMode.Default ? SortMode.UpdateDesc : SortMode.Default,
|
||||
);
|
||||
},
|
||||
};
|
||||
@@ -58,7 +58,7 @@ export default function PluginPage(): React.ReactNode {
|
||||
const getSortedPlugins = (plugins: Plugin[]): Plugin[] => {
|
||||
if (sortMode === SortMode.UpdateDesc) {
|
||||
return [...plugins].sort(
|
||||
(a, b) => new Date(b.time).getTime() - new Date(a.time).getTime()
|
||||
(a, b) => new Date(b.time).getTime() - new Date(a.time).getTime(),
|
||||
);
|
||||
}
|
||||
return plugins;
|
||||
@@ -124,14 +124,14 @@ export default function PluginPage(): React.ReactNode {
|
||||
(tag: string) => {
|
||||
addFilter(tagFilter(tag));
|
||||
},
|
||||
[addFilter]
|
||||
[addFilter],
|
||||
);
|
||||
|
||||
const onCardAuthorClick = useCallback(
|
||||
(author: string) => {
|
||||
addFilter(authorFilter(author));
|
||||
},
|
||||
[addFilter]
|
||||
[addFilter],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -22,7 +22,7 @@ type Props = {
|
||||
function StorePage({ title, children }: Props): React.ReactNode {
|
||||
const sidebarItems = useVersionedSidebar(
|
||||
useDocsVersionCandidates()[0].name,
|
||||
SIDEBAR_ID
|
||||
SIDEBAR_ID,
|
||||
)!;
|
||||
|
||||
return (
|
||||
|
||||
@@ -125,7 +125,7 @@ export default function StoreToolbar({
|
||||
<button
|
||||
className={clsx(
|
||||
"btn btn-sm btn-primary no-animation mr-2",
|
||||
!sorter.active && "btn-outline"
|
||||
!sorter.active && "btn-outline",
|
||||
)}
|
||||
onClick={sorter.onClick}
|
||||
>
|
||||
@@ -154,7 +154,7 @@ export default function StoreToolbar({
|
||||
<button
|
||||
className={clsx(
|
||||
"btn btn-sm btn-primary no-animation mr-2",
|
||||
!sorter.active && "btn-outline"
|
||||
!sorter.active && "btn-outline",
|
||||
)}
|
||||
onClick={sorter.onClick}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user