From a5898eab5504472d286e066586918163527f427d Mon Sep 17 00:00:00 2001 From: Soon Date: Fri, 19 Jul 2024 13:58:48 +0800 Subject: [PATCH] ci(website/infra): lint-staged issue in website (#7224) * chore: try * chore: run biome lint --- .github/workflows/ci.yml | 1 - .../components/CommunityCompatibleTable.tsx | 10 +- .../components/PluginSupportStatusTable.tsx | 6 +- website/package.json | 7 +- website/pnpm-lock.yaml | 99 +++++++++++++++++++ website/theme/components/Benchmark/index.tsx | 1 + 6 files changed, 113 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ce74dd5358..c1b27eb2a9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -207,7 +207,6 @@ jobs: run: | cd website pnpm install - npx @biomejs/biome check --diagnostic-level=warn pnpm run check:ci rust_changes: diff --git a/website/components/CommunityCompatibleTable.tsx b/website/components/CommunityCompatibleTable.tsx index e56bf24c5ff..1042a437d72 100644 --- a/website/components/CommunityCompatibleTable.tsx +++ b/website/components/CommunityCompatibleTable.tsx @@ -6,11 +6,11 @@ import S from './PluginSupportStatusTable.module.scss'; import * as i18n from './i18n'; export enum CompatibleStatus { - NotCompatible, - PartiallyCompatible, - Alternative, - Compatible, - Included, + NotCompatible = 0, + PartiallyCompatible = 1, + Alternative = 2, + Compatible = 3, + Included = 4, } const SUPPORT_STATUS_LOCALIZED = { diff --git a/website/components/PluginSupportStatusTable.tsx b/website/components/PluginSupportStatusTable.tsx index 253866bd95c..bc57b240c34 100644 --- a/website/components/PluginSupportStatusTable.tsx +++ b/website/components/PluginSupportStatusTable.tsx @@ -4,9 +4,9 @@ import { useLang } from 'rspress/runtime'; import S from './PluginSupportStatusTable.module.scss'; enum SupportStatus { - NotSupported, - PartiallySupported, - FullySupported, + NotSupported = 0, + PartiallySupported = 1, + FullySupported = 2, } const SUPPORT_STATUS_LOCALIZED = { diff --git a/website/package.json b/website/package.json index c98c1f1fbdd..abaee2556e2 100644 --- a/website/package.json +++ b/website/package.json @@ -7,12 +7,14 @@ "build": "rspress build", "preview": "rspress preview", "sort-projects-words": "node ./sortProjectWords.js", + "check:lint": "biome check --diagnostic-level=warn --write", + "check:lint-ci": "biome check --diagnostic-level=warn", "check:format": "prettier . --write", "check:format-ci": "prettier . --check", "check:spell": "npx cspell", "check:case": "npx case-police docs/**/*.{md,mdx}", - "check": "pnpm run check:format && pnpm run check:spell", - "check:ci": "pnpm run check:format-ci && pnpm run check:spell" + "check": "pnpm run check:lint && pnpm run check:format && pnpm run check:spell", + "check:ci": "pnpm run check:lint-ci && pnpm run check:format-ci && pnpm run check:spell" }, "license": "MIT", "packageManager": "pnpm@9.3.0", @@ -28,6 +30,7 @@ "tailwindcss": "^3.2.7" }, "devDependencies": { + "@biomejs/biome": "1.8.0", "@rspress/plugin-rss": "^1.26.1", "@rspress/shared": "^1.26.1", "@types/node": "^18.11.18", diff --git a/website/pnpm-lock.yaml b/website/pnpm-lock.yaml index 3027ae70281..d9851b79ce0 100644 --- a/website/pnpm-lock.yaml +++ b/website/pnpm-lock.yaml @@ -36,6 +36,9 @@ importers: specifier: ^3.2.7 version: 3.4.1 devDependencies: + '@biomejs/biome': + specifier: 1.8.0 + version: 1.8.0 '@rspress/plugin-rss': specifier: ^1.26.1 version: 1.26.2(react@18.2.0)(rspress@1.26.2(webpack@5.91.0)) @@ -92,6 +95,63 @@ packages: resolution: {integrity: sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==} engines: {node: '>=6.9.0'} + '@biomejs/biome@1.8.0': + resolution: {integrity: sha512-34xcE2z8GWrIz1sCFEmlHT/+4d+SN7YOqqvzlAKXKvaWPRJ2/NUwxPbRsP01P9QODkQ5bvGvc9rpBihmP+7RJQ==} + engines: {node: '>=14.21.3'} + hasBin: true + + '@biomejs/cli-darwin-arm64@1.8.0': + resolution: {integrity: sha512-dBAYzfIJ1JmWigKlWourT3sJ3I60LZPjqNwwlsyFjiv5AV7vPeWlHVVIImV2BpINwNjZQhpXnwDfVnGS4vr7AA==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [darwin] + + '@biomejs/cli-darwin-x64@1.8.0': + resolution: {integrity: sha512-ZTTSD0bP0nn9UpRDGQrQNTILcYSj+IkxTYr3CAV64DWBDtQBomlk2oVKWzDaA1LOhpAsTh0giLCbPJaVk2jfMQ==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [darwin] + + '@biomejs/cli-linux-arm64-musl@1.8.0': + resolution: {integrity: sha512-+ee/pZWsvhDv6eRI00krRNSgAg8DKSxzOv3LUsCjto6N1VzqatTASeQv2HRfG1nitf79rRKM75LkMJbqEfiKww==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@biomejs/cli-linux-arm64@1.8.0': + resolution: {integrity: sha512-cx725jTlJS6dskvJJwwCQaaMRBKE2Qss7ukzmx27Rn/DXRxz6tnnBix4FUGPf1uZfwrERkiJlbWM05JWzpvvXg==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@biomejs/cli-linux-x64-musl@1.8.0': + resolution: {integrity: sha512-VPA4ocrAOak50VYl8gOAVnjuFFDpIUolShntc/aWM0pZfSIMbRucxnrfUfp44EVwayxjK6ruJTR5xEWj93WvDA==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@biomejs/cli-linux-x64@1.8.0': + resolution: {integrity: sha512-cmgmhlD4QUxMhL1VdaNqnB81xBHb3R7huVNyYnPYzP+AykZ7XqJbPd1KcWAszNjUk2AHdx0aLKEBwCOWemxb2g==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@biomejs/cli-win32-arm64@1.8.0': + resolution: {integrity: sha512-J31spvlh39FfRHQacYXxJX9PvTCH/a8+2Jx9D1lxw+LSF0JybqZcw/4JrlFUWUl4kF3yv8AuYUK0sENScc3g9w==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [win32] + + '@biomejs/cli-win32-x64@1.8.0': + resolution: {integrity: sha512-uPHHvu76JC1zYe9zZDcOU9PAg+1MZmPuNgWkb5jljaDeATvzLFPB+0nuJTilf603LXL+E8IdPQAO61Wy2VuEJA==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [win32] + '@bufbuild/protobuf@1.10.0': resolution: {integrity: sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==} @@ -402,21 +462,25 @@ packages: resolution: {integrity: sha512-EjzyZWZSjo02ReGUzQPt8sY1hEx2V9lEbg1cqgnE1NpSOS77ratNoAvS3gAzXL6NGWRhYrIH2yaN+6OB9olt/g==} cpu: [arm64] os: [linux] + libc: [glibc] '@rspack/binding-linux-arm64-musl@1.0.0-alpha.3': resolution: {integrity: sha512-HJQ52KWNnMOFqbXhaIHTAr54ES5LSunJF6SLnIMgElReC39WvUNDmHhCA5yPebkXgY2SDrLIKDmqxouZmYWulQ==} cpu: [arm64] os: [linux] + libc: [musl] '@rspack/binding-linux-x64-gnu@1.0.0-alpha.3': resolution: {integrity: sha512-VcpKLI2AZmFOTec8C9YJTdMrgZMrgsQkMeQzTY1uOQuIaAaNCuPBFRdlJaRSTAG0t4aaxaVfR1c3JY8GITacfA==} cpu: [x64] os: [linux] + libc: [glibc] '@rspack/binding-linux-x64-musl@1.0.0-alpha.3': resolution: {integrity: sha512-FypR+RqONTvrgX+SI8sJqhVqv8uhTdq3OHew4ZaL3VN0dp2thmpMX5cJ+XQAsU414OLRTgREU9go2j78n7kvUA==} cpu: [x64] os: [linux] + libc: [musl] '@rspack/binding-win32-arm64-msvc@1.0.0-alpha.3': resolution: {integrity: sha512-aAGQE2TJOhlK6jGYXZyon0JKTP5t2o51/exsSzyH6BSqFce/Qd5w1fqgm6FONTuosrwaBxHSz1pprNq6vx87kA==} @@ -2581,6 +2645,41 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 + '@biomejs/biome@1.8.0': + optionalDependencies: + '@biomejs/cli-darwin-arm64': 1.8.0 + '@biomejs/cli-darwin-x64': 1.8.0 + '@biomejs/cli-linux-arm64': 1.8.0 + '@biomejs/cli-linux-arm64-musl': 1.8.0 + '@biomejs/cli-linux-x64': 1.8.0 + '@biomejs/cli-linux-x64-musl': 1.8.0 + '@biomejs/cli-win32-arm64': 1.8.0 + '@biomejs/cli-win32-x64': 1.8.0 + + '@biomejs/cli-darwin-arm64@1.8.0': + optional: true + + '@biomejs/cli-darwin-x64@1.8.0': + optional: true + + '@biomejs/cli-linux-arm64-musl@1.8.0': + optional: true + + '@biomejs/cli-linux-arm64@1.8.0': + optional: true + + '@biomejs/cli-linux-x64-musl@1.8.0': + optional: true + + '@biomejs/cli-linux-x64@1.8.0': + optional: true + + '@biomejs/cli-win32-arm64@1.8.0': + optional: true + + '@biomejs/cli-win32-x64@1.8.0': + optional: true + '@bufbuild/protobuf@1.10.0': {} '@cspell/cspell-bundled-dicts@8.7.0': diff --git a/website/theme/components/Benchmark/index.tsx b/website/theme/components/Benchmark/index.tsx index 15ab61ac2ec..5ba2c09cf90 100644 --- a/website/theme/components/Benchmark/index.tsx +++ b/website/theme/components/Benchmark/index.tsx @@ -100,6 +100,7 @@ export function Benchmark() { href="misc/benchmark.html" target="_blank" className={`${styles.bottomLink} hover:text-brand transition-colors duration-300 font-medium p-2`} + rel="noreferrer" > 👉 {t('benchmarkDetail')}