chore: fix format (#35)

* chore: fix format

* option 2

* update
This commit is contained in:
Stephen Zhou 2024-06-04 10:48:09 +08:00 committed by GitHub
parent 69b9c861a5
commit ffb34f3586
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 82 additions and 88 deletions

View File

@ -3,10 +3,8 @@ import defineConfig, { GLOB_TS_SRC } from "eslint-config-hyoban"
export default defineConfig(
{
typeChecked: false,
react: "vite",
tailwindCSS: true,
fileCase: false,
stylistic: {
quotes: "double",
arrowParens: true,

View File

@ -97,7 +97,7 @@
"electron-builder": "^24.9.1",
"electron-vite": "^2.2.0",
"eslint": "^9.3.0",
"eslint-config-hyoban": "3.0.0-beta.7",
"eslint-config-hyoban": "3.0.0-beta.10",
"lint-staged": "15.2.5",
"postcss": "8.4.38",
"postcss-js": "4.0.1",

View File

@ -226,8 +226,8 @@ importers:
specifier: ^9.3.0
version: 9.3.0
eslint-config-hyoban:
specifier: 3.0.0-beta.7
version: 3.0.0-beta.7(@typescript-eslint/parser@8.0.0-alpha.20(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(tailwindcss@3.4.3)(typescript@5.4.5)
specifier: 3.0.0-beta.10
version: 3.0.0-beta.10(@typescript-eslint/parser@8.0.0-alpha.20(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(tailwindcss@3.4.3)(typescript@5.4.5)
lint-staged:
specifier: 15.2.5
version: 15.2.5
@ -2812,8 +2812,8 @@ packages:
eslint-config-flat-gitignore@0.1.5:
resolution: {integrity: sha512-hEZLwuZjDBGDERA49c2q7vxc8sCGv8EdBp6PQYzGOMcHIgrfG9YOM6s/4jx24zhD+wnK9AI8mgN5RxSss5nClQ==}
eslint-config-hyoban@3.0.0-beta.7:
resolution: {integrity: sha512-F+2d0m//HfpFhD5ulSjwZwAsoKg1+EOxYWDBWr8bSlzQsBhcq/6eGhriKkUJ2GbXyCllRdqFv9lZlDc6KBvPUQ==}
eslint-config-hyoban@3.0.0-beta.10:
resolution: {integrity: sha512-D93zIpk66nL5c6uIGhIiBjqe9w6IYaf8JePpiv/MsZIcr989bWH0MhjD4QAUNpv4rcDqgqTYj3yEsZmheX+jFQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
@ -8170,7 +8170,7 @@ snapshots:
find-up: 7.0.0
parse-gitignore: 2.0.0
eslint-config-hyoban@3.0.0-beta.7(@typescript-eslint/parser@8.0.0-alpha.20(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(tailwindcss@3.4.3)(typescript@5.4.5):
eslint-config-hyoban@3.0.0-beta.10(@typescript-eslint/parser@8.0.0-alpha.20(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(tailwindcss@3.4.3)(typescript@5.4.5):
dependencies:
'@cspell/eslint-plugin': 8.8.3(eslint@9.3.0)
'@eslint-react/eslint-plugin': 1.5.14(@typescript-eslint/parser@8.0.0-alpha.20(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(typescript@5.4.5)

View File

@ -137,87 +137,83 @@ export function DiscoverForm({ type }: { type: string }) {
docs={item.docs}
/>
</CardHeader>
{item.docs ?
(
<CardFooter>
<a href={item.docs} target="_blank" rel="noreferrer">
<Button>View Docs</Button>
</a>
</CardFooter>
) :
(
<>
<CardContent>
{!!item.entries?.length && (
<div className="grid grid-cols-4 gap-4">
{item.entries
.filter((e) => !!e)
.map((entry) => {
const assertEntry = entry
return (
<a
key={assertEntry.id}
href={assertEntry.url || void 0}
target="_blank"
className="flex min-w-0 flex-1 flex-col items-center gap-1"
rel="noreferrer"
>
{assertEntry.images?.[0] ?
(
<Image
src={assertEntry.images?.[0]}
className="aspect-square w-full"
/>
) :
(
<div className="flex aspect-square w-full overflow-hidden rounded bg-stone-100 p-2 text-xs leading-tight text-zinc-500">
{assertEntry.title}
</div>
)}
<div className="line-clamp-2 w-full text-xs leading-tight">
{assertEntry.title}
</div>
</a>
)
})}
</div>
)}
</CardContent>
<CardFooter>
{item.isSubscribed ?
(
<Button variant="outline" disabled>
Followed
</Button>
) :
(
<Button
onClick={() =>
openElectronWindow(
`${DEEPLINK_SCHEME}add${
item.feed.id ?
`?id=${item.feed.id}` :
`?url=${item.feed.url}`
}`,
{
resizeable: false,
height: 550,
},
)}
{item.docs ? (
<CardFooter>
<a href={item.docs} target="_blank" rel="noreferrer">
<Button>View Docs</Button>
</a>
</CardFooter>
) : (
<>
<CardContent>
{!!item.entries?.length && (
<div className="grid grid-cols-4 gap-4">
{item.entries
.filter((e) => !!e)
.map((entry) => {
const assertEntry = entry
return (
<a
key={assertEntry.id}
href={assertEntry.url || void 0}
target="_blank"
className="flex min-w-0 flex-1 flex-col items-center gap-1"
rel="noreferrer"
>
Follow
</Button>
)}
<div className="ml-6 text-zinc-500">
<span className="font-medium text-zinc-800">
{item.subscriptionCount}
</span>
{" "}
Followers
</div>
</CardFooter>
</>
)}
{assertEntry.images?.[0] ? (
<Image
src={assertEntry.images?.[0]}
className="aspect-square w-full"
/>
) : (
<div className="flex aspect-square w-full overflow-hidden rounded bg-stone-100 p-2 text-xs leading-tight text-zinc-500">
{assertEntry.title}
</div>
)}
<div className="line-clamp-2 w-full text-xs leading-tight">
{assertEntry.title}
</div>
</a>
)
})}
</div>
)}
</CardContent>
<CardFooter>
{item.isSubscribed ? (
<Button variant="outline" disabled>
Followed
</Button>
) : (
<Button
onClick={
() =>
openElectronWindow(
`${DEEPLINK_SCHEME}add${
item.feed.id ?
`?id=${item.feed.id}` :
`?url=${item.feed.url}`
}`,
{
resizeable: false,
height: 550,
},
)
}
>
Follow
</Button>
)}
<div className="ml-6 text-zinc-500">
<span className="font-medium text-zinc-800">
{item.subscriptionCount}
</span>
{" "}
Followers
</div>
</CardFooter>
</>
)}
</Card>
))}
</div>