From 818cd021a15ec03e7d9c3c879d6a2e911a551c5d Mon Sep 17 00:00:00 2001 From: tequ Date: Tue, 4 Nov 2025 22:30:25 +0900 Subject: [PATCH] update biome (support astro, css format) --- .vscode/settings.json | 6 +- biome.jsonc | 35 +- package-lock.json | 72 +-- package.json | 4 +- src/components/CookieConsent.astro | 13 +- src/components/DocsForceLightTheme.astro | 8 +- src/components/DocsMobileMenuToggle.astro | 173 ++++---- src/components/DocsPageSidebar.astro | 102 ++--- src/components/DocsSidebar.astro | 15 +- src/components/DocsTwoColumnContent.astro | 86 ++-- src/components/EcosystemButton.astro | 10 +- src/components/Footer.astro | 42 +- src/components/PageSection.astro | 102 +++-- src/layouts/BaseLayout.astro | 72 +-- src/layouts/DocsLayout.astro | 147 ++++--- src/layouts/IndexLayout.astro | 152 +++++-- src/layouts/PageLayout.astro | 15 +- src/pages/fraud-report.astro | 511 ++++++++++++++-------- src/styles/docs.css | 6 +- src/styles/global.css | 1 - src/styles/main.css | 4 +- 21 files changed, 937 insertions(+), 639 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 184991f..756b7f3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,9 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "biomejs.biome", "editor.codeActionsOnSave": { - "quickfix.biome": "explicit", - "source.organizeImports.biome": "explicit" + "source.fixAll.biome": "explicit" + }, + "files.associations": { + "*.css": "tailwindcss" } } diff --git a/biome.jsonc b/biome.jsonc index f8f0ca3..27b116e 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -1,12 +1,12 @@ { - "$schema": "https://biomejs.dev/schemas/2.0.6/schema.json", + "$schema": "https://biomejs.dev/schemas/2.3.3/schema.json", "vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false }, "files": { - "includes": ["**", "!*/**/*.astro", "!.astro", "!dist"], + "includes": ["**", "!dist"], "ignoreUnknown": false }, "formatter": { @@ -17,7 +17,24 @@ "linter": { "enabled": true, "rules": { - "recommended": true + "recommended": true, + "suspicious": { + "noExplicitAny": "info" + }, + "complexity": { + "noBannedTypes": "info" + }, + "correctness": { + "noUnusedImports": "off" + } + } + }, + "html": { + "experimentalFullSupportEnabled": true, + "formatter": { + "enabled": true, + "indentScriptAndStyle": true, + "indentStyle": "space" } }, "javascript": { @@ -26,6 +43,18 @@ "semicolons": "asNeeded" } }, + "css": { + "parser": { + "tailwindDirectives": true, + "cssModules": true + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 2, + "quoteStyle": "single" + } + }, "assist": { "enabled": true, "actions": { diff --git a/package-lock.json b/package-lock.json index 77ce936..8c0f7ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "vanilla-cookieconsent": "^3.1.0" }, "devDependencies": { - "@biomejs/biome": "^2.0.6" + "@biomejs/biome": "^2.3.3" } }, "node_modules/@altcha/crypto": { @@ -485,9 +485,9 @@ } }, "node_modules/@biomejs/biome": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.0.6.tgz", - "integrity": "sha512-RRP+9cdh5qwe2t0gORwXaa27oTOiQRQvrFf49x2PA1tnpsyU7FIHX4ZOFMtBC4QNtyWsN7Dqkf5EDbg4X+9iqA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.3.3.tgz", + "integrity": "sha512-zn/P1pRBCpDdhi+VNSMnpczOz9DnqzOA2c48K8xgxjDODvi5O8gs3a2H233rck/5HXpkFj6TmyoqVvxirZUnvg==", "dev": true, "license": "MIT OR Apache-2.0", "bin": { @@ -501,20 +501,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "2.0.6", - "@biomejs/cli-darwin-x64": "2.0.6", - "@biomejs/cli-linux-arm64": "2.0.6", - "@biomejs/cli-linux-arm64-musl": "2.0.6", - "@biomejs/cli-linux-x64": "2.0.6", - "@biomejs/cli-linux-x64-musl": "2.0.6", - "@biomejs/cli-win32-arm64": "2.0.6", - "@biomejs/cli-win32-x64": "2.0.6" + "@biomejs/cli-darwin-arm64": "2.3.3", + "@biomejs/cli-darwin-x64": "2.3.3", + "@biomejs/cli-linux-arm64": "2.3.3", + "@biomejs/cli-linux-arm64-musl": "2.3.3", + "@biomejs/cli-linux-x64": "2.3.3", + "@biomejs/cli-linux-x64-musl": "2.3.3", + "@biomejs/cli-win32-arm64": "2.3.3", + "@biomejs/cli-win32-x64": "2.3.3" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.0.6.tgz", - "integrity": "sha512-AzdiNNjNzsE6LfqWyBvcL29uWoIuZUkndu+wwlXW13EKcBHbbKjNQEZIJKYDc6IL+p7bmWGx3v9ZtcRyIoIz5A==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.3.3.tgz", + "integrity": "sha512-5+JtW6RKmjqL9un0UtHV0ezOslAyYBzyl5ZhYiu7GHesX2x8NCDl6tXYrenv9m7e1RLbkO5E5Kh04kseMtz6lw==", "cpu": [ "arm64" ], @@ -529,9 +529,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.0.6.tgz", - "integrity": "sha512-wJjjP4E7bO4WJmiQaLnsdXMa516dbtC6542qeRkyJg0MqMXP0fvs4gdsHhZ7p9XWTAmGIjZHFKXdsjBvKGIJJQ==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.3.3.tgz", + "integrity": "sha512-UPmKRalkHicvIpeccuKqq+/gA2HYV8FUnAEDJnqYBlGlycKqe6xrovWqvWTE4TTNpIFf4UQyuaDzLkN6Kz6tbA==", "cpu": [ "x64" ], @@ -546,9 +546,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.0.6.tgz", - "integrity": "sha512-ZSVf6TYo5rNMUHIW1tww+rs/krol7U5A1Is/yzWyHVZguuB0lBnIodqyFuwCNqG9aJGyk7xIMS8HG0qGUPz0SA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.3.3.tgz", + "integrity": "sha512-zeiKwALNB/hax7+LLhCYqhqzlWdTfgE9BGkX2Z8S4VmCYnGFrf2fON/ec6KCos7mra5MDm6fYICsEWN2+HKZhw==", "cpu": [ "arm64" ], @@ -563,9 +563,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.0.6.tgz", - "integrity": "sha512-CVPEMlin3bW49sBqLBg2x016Pws7eUXA27XYDFlEtponD0luYjg2zQaMJ2nOqlkKG9fqzzkamdYxHdMDc2gZFw==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.3.3.tgz", + "integrity": "sha512-KhCDMV+V7Yu72v40ssGJTHuv/j0n7JQ6l0s/c+EMcX5zPYLMLr4XpmI+WXhp4Vfkz0T5Xnh5wbrTBI3f2UTpjQ==", "cpu": [ "arm64" ], @@ -580,9 +580,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.0.6.tgz", - "integrity": "sha512-geM1MkHTV1Kh2Cs/Xzot9BOF3WBacihw6bkEmxkz4nSga8B9/hWy5BDiOG3gHDGIBa8WxT0nzsJs2f/hPqQIQw==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.3.3.tgz", + "integrity": "sha512-05CjPLbvVVU8J6eaO6iSEoA0FXKy2l6ddL+1h/VpiosCmIp3HxRKLOa1hhC1n+D13Z8g9b1DtnglGtM5U3sTag==", "cpu": [ "x64" ], @@ -597,9 +597,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.0.6.tgz", - "integrity": "sha512-mKHE/e954hR/hSnAcJSjkf4xGqZc/53Kh39HVW1EgO5iFi0JutTN07TSjEMg616julRtfSNJi0KNyxvc30Y4rQ==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.3.3.tgz", + "integrity": "sha512-IyqQ+jYzU5MVy9CK5NV0U+NnUMPUAhYMrB/x4QgL/Dl1MqzBVc61bHeyhLnKM6DSEk73/TQYrk/8/QmVHudLdQ==", "cpu": [ "x64" ], @@ -614,9 +614,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.0.6.tgz", - "integrity": "sha512-290V4oSFoKaprKE1zkYVsDfAdn0An5DowZ+GIABgjoq1ndhvNxkJcpxPsiYtT7slbVe3xmlT0ncdfOsN7KruzA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.3.3.tgz", + "integrity": "sha512-NtlLs3pdFqFAQYZjlEHKOwJEn3GEaz7rtR2oCrzaLT2Xt3Cfd55/VvodQ5V+X+KepLa956QJagckJrNL+DmumQ==", "cpu": [ "arm64" ], @@ -631,9 +631,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.0.6.tgz", - "integrity": "sha512-bfM1Bce0d69Ao7pjTjUS+AWSZ02+5UHdiAP85Th8e9yV5xzw6JrHXbL5YWlcEKQ84FIZMdDc7ncuti1wd2sdbw==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.3.3.tgz", + "integrity": "sha512-klJKPPQvUk9Rlp0Dd56gQw/+Wt6uUprHdHWtbDC93f3Iv+knA2tLWpcYoOZJgPV+9s+RBmYv0DGy4mUlr20esg==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index 91215df..79639ab 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "astro build", "preview": "astro preview", "check": "biome check --write", - "ci": "biome ci" + "ci": "biome ci --diagnostic-level=warn" }, "dependencies": { "@astrojs/mdx": "^4.3.0", @@ -28,6 +28,6 @@ "vanilla-cookieconsent": "^3.1.0" }, "devDependencies": { - "@biomejs/biome": "^2.0.6" + "@biomejs/biome": "^2.3.3" } } diff --git a/src/components/CookieConsent.astro b/src/components/CookieConsent.astro index 5717c4f..dcf9b4f 100644 --- a/src/components/CookieConsent.astro +++ b/src/components/CookieConsent.astro @@ -1,10 +1,11 @@ --- -import 'vanilla-cookieconsent/dist/cookieconsent.css' + import 'vanilla-cookieconsent/dist/cookieconsent.css' --- \ No newline at end of file + run(config) + + document.body.classList.add('cc--darkmode') + diff --git a/src/components/DocsForceLightTheme.astro b/src/components/DocsForceLightTheme.astro index 5d9b900..3d011e8 100644 --- a/src/components/DocsForceLightTheme.astro +++ b/src/components/DocsForceLightTheme.astro @@ -1,12 +1,8 @@ ---- - ---- - \ No newline at end of file + diff --git a/src/components/DocsMobileMenuToggle.astro b/src/components/DocsMobileMenuToggle.astro index 463bdd5..4d9b0ba 100644 --- a/src/components/DocsMobileMenuToggle.astro +++ b/src/components/DocsMobileMenuToggle.astro @@ -1,111 +1,110 @@ --- -import { - Bars3Icon, - ChevronDownIcon, - XMarkIcon, -} from '@heroicons/react/20/solid' + import { + Bars3Icon, + ChevronDownIcon, + XMarkIcon, + } from '@heroicons/react/20/solid' --- - - + \ No newline at end of file + @media (min-width: 50rem) { + [data-mobile-menu-expanded] { + overflow: auto; + } + } + } + diff --git a/src/components/DocsPageSidebar.astro b/src/components/DocsPageSidebar.astro index 758680d..8c21dd9 100644 --- a/src/components/DocsPageSidebar.astro +++ b/src/components/DocsPageSidebar.astro @@ -1,55 +1,59 @@ --- -import TableOfContents from '@astrojs/starlight/components/TableOfContents.astro' + import TableOfContents from '@astrojs/starlight/components/TableOfContents.astro' --- - { - Astro.locals.starlightRoute.toc && ( - <> - - - ) + Astro.locals.starlightRoute.toc && ( + <> + + + ) } \ No newline at end of file + @layer starlight.core { + .right-sidebar-panel { + padding: 1rem var(--sl-sidebar-pad-x); + } + .sl-container { + width: calc(var(--sl-sidebar-width) - 2 * var(--sl-sidebar-pad-x)); + } + .right-sidebar-panel :global(h2) { + color: var(--sl-color-white); + font-size: var(--sl-text-h5); + font-weight: 600; + line-height: var(--sl-line-height-headings); + margin-bottom: 0.5rem; + } + .right-sidebar-panel :global(:where(a)) { + display: block; + font-size: var(--sl-text-xs); + text-decoration: none; + color: var(--sl-color-gray-3); + overflow-wrap: anywhere; + } + .right-sidebar-panel :global(:where(a):hover) { + color: var(--sl-color-white); + } + @media (min-width: 72rem) { + .sl-container { + max-width: calc( + ( + ( + 100vw - + var(--sl-sidebar-width) - + 2 * + var(--sl-content-pad-x) - + 2 * + var(--sl-sidebar-pad-x) + ) * + 0.25 /* MAGIC NUMBER 🥲 */ + ) + ); + } + } + } + diff --git a/src/components/DocsSidebar.astro b/src/components/DocsSidebar.astro index c1f260b..ecc22d8 100644 --- a/src/components/DocsSidebar.astro +++ b/src/components/DocsSidebar.astro @@ -1,12 +1,11 @@ --- -import SidebarPersister from '@astrojs/starlight/components/SidebarPersister.astro' -import SidebarSublist from '@astrojs/starlight/components/SidebarSublist.astro' -import Search from '@astrojs/starlight/components/Search.astro' + import Search from '@astrojs/starlight/components/Search.astro' + import SidebarPersister from '@astrojs/starlight/components/SidebarPersister.astro' + import SidebarSublist from '@astrojs/starlight/components/SidebarSublist.astro' -const { sidebar } = Astro.locals.starlightRoute + const _sidebar = Astro.locals.starlightRoute.sidebar --- - - \ No newline at end of file +