From e914165bf7d53d693470873b8f6105450ec7d422 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 13 Apr 2026 11:37:11 +0800 Subject: [PATCH 1/2] chore: migrate from biome to prettier and rslint --- .github/workflows/release.yml | 4 +- .github/workflows/test.yml | 2 +- .prettierignore | 3 + .prettierrc | 3 + .vscode/extensions.json | 2 +- .vscode/settings.json | 16 +-- README.md | 6 +- biome.json | 31 ------ package.json | 19 ++-- pnpm-lock.yaml | 189 ++++++++++++++++------------------ rslint.config.ts | 3 + 11 files changed, 111 insertions(+), 167 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc delete mode 100644 biome.json create mode 100644 rslint.config.ts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae717c4..c014c05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: # Run `npm run bump` to bump the version and create a git tag. push: tags: - - "v*" + - 'v*' workflow_dispatch: @@ -46,4 +46,4 @@ jobs: - name: Create GitHub Release uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1 with: - generateReleaseNotes: "true" + generateReleaseNotes: 'true' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 61a8760..9132de7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 with: node-version: 24.14.1 - cache: "pnpm" + cache: 'pnpm' - name: Install Dependencies run: pnpm install && npx playwright install diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..79e4884 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +# Ignore artifacts: +dist +pnpm-lock.yaml diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..544138b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 699ed73..f172f18 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,3 @@ { - "recommendations": ["biomejs.biome"] + "recommendations": ["rstack.rslint", "esbenp.prettier-vscode"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 58f2f56..770e0e6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,18 +1,4 @@ { "search.useIgnoreFiles": true, - "[json]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[typescript]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[javascript]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[javascriptreact]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[css]": { - "editor.defaultFormatter": "biomejs.biome" - } + "editor.defaultFormatter": "esbenp.prettier-vscode" } diff --git a/README.md b/README.md index 6d5a33b..d67204b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Add plugin to your `rsbuild.config.ts`: ```ts // rsbuild.config.ts -import { pluginEjs } from "rsbuild-plugin-ejs"; +import { pluginEjs } from 'rsbuild-plugin-ejs'; export default { plugins: [pluginEjs()], @@ -37,7 +37,7 @@ For example, first create a `src/index.ejs` file, and point to that file using ` ```ts title="rsbuild.config.ts" export default { html: { - template: "./src/index.ejs", + template: './src/index.ejs', }, }; ``` @@ -74,7 +74,7 @@ const defaultOptions = { ```ts pluginEjs({ ejsOptions: { - delimiter: "|", + delimiter: '|', }, }); ``` diff --git a/biome.json b/biome.json deleted file mode 100644 index 348ebd5..0000000 --- a/biome.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", - "organizeImports": { - "enabled": true - }, - "vcs": { - "enabled": true, - "defaultBranch": "main", - "clientKind": "git", - "useIgnoreFile": true - }, - "formatter": { - "indentStyle": "space" - }, - "javascript": { - "formatter": { - "quoteStyle": "single" - } - }, - "css": { - "formatter": { - "enabled": true - } - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true - } - } -} diff --git a/package.json b/package.json index e9368f9..5de7b00 100644 --- a/package.json +++ b/package.json @@ -11,32 +11,29 @@ } }, "types": "./dist/index.d.ts", - "files": ["dist"], + "files": [ + "dist" + ], "scripts": { "build": "rslib", "dev": "rslib -w", - "lint": "biome check .", - "lint:write": "biome check . --write", + "lint": "rslint && prettier -c .", + "lint:write": "rslint --fix && prettier -w .", "prepare": "simple-git-hooks && npm run build", "test": "playwright test", "bump": "npx bumpp" }, "simple-git-hooks": { - "pre-commit": "npx nano-staged" - }, - "nano-staged": { - "*.{js,jsx,ts,tsx,mjs,cjs}": [ - "biome check --write --no-errors-on-unmatched" - ] + "pre-commit": "pnpm run lint:write" }, "devDependencies": { - "@biomejs/biome": "^1.9.4", "@playwright/test": "^1.59.1", "@rsbuild/core": "^1.7.5", "@rslib/core": "^0.21.0", + "@rslint/core": "0.4.1", "@types/node": "^24.12.2", - "nano-staged": "^1.0.2", "playwright": "^1.59.1", + "prettier": "^3.8.1", "simple-git-hooks": "^2.13.1", "typescript": "6.0.2" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d35c387..d219409 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,9 +15,6 @@ importers: specifier: ^5.0.2 version: 5.0.2 devDependencies: - '@biomejs/biome': - specifier: ^1.9.4 - version: 1.9.4 '@playwright/test': specifier: ^1.59.1 version: 1.59.1 @@ -27,15 +24,18 @@ importers: '@rslib/core': specifier: ^0.21.0 version: 0.21.0(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(core-js@3.47.0)(typescript@6.0.2) + '@rslint/core': + specifier: 0.4.1 + version: 0.4.1(jiti@2.6.1) '@types/node': specifier: ^24.12.2 version: 24.12.2 - nano-staged: - specifier: ^1.0.2 - version: 1.0.2 playwright: specifier: ^1.59.1 version: 1.59.1 + prettier: + specifier: ^3.8.1 + version: 3.8.2 simple-git-hooks: specifier: ^2.13.1 version: 2.13.1 @@ -107,63 +107,6 @@ packages: resolution: {integrity: sha512-Hb4o6h1Pf6yRUAX07DR4JVY7dmQw+RVQMW5/m55GoiAT/VRoKCWBtIUPPOnqDVhbx1Cjfil9b6EDrgJsUAujEQ==} engines: {node: '>= 10'} - '@biomejs/biome@1.9.4': - resolution: {integrity: sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==} - engines: {node: '>=14.21.3'} - hasBin: true - - '@biomejs/cli-darwin-arm64@1.9.4': - resolution: {integrity: sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [darwin] - - '@biomejs/cli-darwin-x64@1.9.4': - resolution: {integrity: sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [darwin] - - '@biomejs/cli-linux-arm64-musl@1.9.4': - resolution: {integrity: sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@biomejs/cli-linux-arm64@1.9.4': - resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@biomejs/cli-linux-x64-musl@1.9.4': - resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [linux] - libc: [musl] - - '@biomejs/cli-linux-x64@1.9.4': - resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@biomejs/cli-win32-arm64@1.9.4': - resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [win32] - - '@biomejs/cli-win32-x64@1.9.4': - resolution: {integrity: sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [win32] - '@emnapi/core@1.9.1': resolution: {integrity: sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==} @@ -233,6 +176,45 @@ packages: typescript: optional: true + '@rslint/core@0.4.1': + resolution: {integrity: sha512-EaW6A6uvk9vDM3fV926gFUApowhmX6VrmJeHu+ENtnzBBW/nnJGs29tCNd2GKF8g7mbICnD4x9OMYS/UkgF/Ow==} + hasBin: true + peerDependencies: + jiti: ^2.0.0 + peerDependenciesMeta: + jiti: + optional: true + + '@rslint/darwin-arm64@0.4.1': + resolution: {integrity: sha512-iUsS/W/ihy9iXC1IqT0MfZfLVK2Iykm4BkbDiMVgDGwCKP5vjQBZfc5eV/e2EOGF60SZbIu2LeD6QSyjOYeU9g==} + cpu: [arm64] + os: [darwin] + + '@rslint/darwin-x64@0.4.1': + resolution: {integrity: sha512-LKlBGS8eYjTDIdXNQSH7euYgbZxvaJR9LgZVP/+O33ky8hG0BDW1jbQ1oFm8DyQIARgIB01UOe9Lmdb88Z0LQA==} + cpu: [x64] + os: [darwin] + + '@rslint/linux-arm64@0.4.1': + resolution: {integrity: sha512-uJuy03rRGudGXgXLyvDmX5cLlXTO2It3NzA3G95rdXY52vyIRNrb1Z63yYw7+6MqycJnsnz8LKoDjgfWWqlDsQ==} + cpu: [arm64] + os: [linux] + + '@rslint/linux-x64@0.4.1': + resolution: {integrity: sha512-0VGYCgj82kZ8xJu5ximVO3u1fiA2zAzGRbhwFgjoThyIGiKFaIZhqc7wfEt/z1/aHlWRdIG1c+fWqlomh3U66w==} + cpu: [x64] + os: [linux] + + '@rslint/win32-arm64@0.4.1': + resolution: {integrity: sha512-BztIuv8PAWOGKtTu4T+idy7DMebTlLzdYtND+qt4ba4sIxgz0jEQujmK+zn3rNmu6lLhdVECPZQ6/z6hpIF5yw==} + cpu: [arm64] + os: [win32] + + '@rslint/win32-x64@0.4.1': + resolution: {integrity: sha512-a3KKGyVxf7lL4VE2v5MogQ29yocrA/24lUsEok2ZKXcdZMf/XRZV5BgXTIGNymnGo9H69QhR+aC1iNHU1Sal8w==} + cpu: [x64] + os: [win32] + '@rspack/binding-darwin-arm64@1.7.10': resolution: {integrity: sha512-bsXi7I6TpH+a4L6okIUh1JDvwT+XcK/L7Yvhu5G2t5YYyd2fl5vMM5O9cePRpEb0RdqJZ3Z8i9WIWHap9aQ8Gw==} cpu: [arm64] @@ -398,10 +380,9 @@ packages: resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} hasBin: true - nano-staged@1.0.2: - resolution: {integrity: sha512-Fytar3zHLY99nlMfqPPbraxZodqQAHPpdPRyYaplL+lB9DCR6pUrafxbG+Btz4+7fO5Rm/+DO4ZeDO/nLSUMhw==} - engines: {node: ^22 || >= 24} - hasBin: true + picomatch@4.0.4: + resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} + engines: {node: '>=12'} playwright-core@1.59.1: resolution: {integrity: sha512-HBV/RJg81z5BiiZ9yPzIiClYV/QMsDCKUyogwH9p3MCP6IYjUFu/MActgYAvK0oWyV9NlwM3GLBjADyWgydVyg==} @@ -413,6 +394,11 @@ packages: engines: {node: '>=18'} hasBin: true + prettier@3.8.2: + resolution: {integrity: sha512-8c3mgTe0ASwWAJK+78dpviD+A8EqhndQPUBpNUIPt6+xWlIigCwfN01lWr9MAede4uqXGTEKeQWTvzb3vjia0Q==} + engines: {node: '>=14'} + hasBin: true + rsbuild-plugin-dts@0.21.0: resolution: {integrity: sha512-bnn0pTVEAUfW3vcXYuo6US9QAO2SqQT7wjBBUer4ZtQAbberPF8soBQZWicPVC1t8mZZeVzg/PR0DHqKE7Hthw==} engines: {node: ^20.19.0 || >=22.12.0} @@ -485,41 +471,6 @@ snapshots: '@ast-grep/napi-win32-ia32-msvc': 0.37.0 '@ast-grep/napi-win32-x64-msvc': 0.37.0 - '@biomejs/biome@1.9.4': - optionalDependencies: - '@biomejs/cli-darwin-arm64': 1.9.4 - '@biomejs/cli-darwin-x64': 1.9.4 - '@biomejs/cli-linux-arm64': 1.9.4 - '@biomejs/cli-linux-arm64-musl': 1.9.4 - '@biomejs/cli-linux-x64': 1.9.4 - '@biomejs/cli-linux-x64-musl': 1.9.4 - '@biomejs/cli-win32-arm64': 1.9.4 - '@biomejs/cli-win32-x64': 1.9.4 - - '@biomejs/cli-darwin-arm64@1.9.4': - optional: true - - '@biomejs/cli-darwin-x64@1.9.4': - optional: true - - '@biomejs/cli-linux-arm64-musl@1.9.4': - optional: true - - '@biomejs/cli-linux-arm64@1.9.4': - optional: true - - '@biomejs/cli-linux-x64-musl@1.9.4': - optional: true - - '@biomejs/cli-linux-x64@1.9.4': - optional: true - - '@biomejs/cli-win32-arm64@1.9.4': - optional: true - - '@biomejs/cli-win32-x64@1.9.4': - optional: true - '@emnapi/core@1.9.1': dependencies: '@emnapi/wasi-threads': 1.2.0 @@ -611,6 +562,36 @@ snapshots: - '@typescript/native-preview' - core-js + '@rslint/core@0.4.1(jiti@2.6.1)': + dependencies: + picomatch: 4.0.4 + optionalDependencies: + '@rslint/darwin-arm64': 0.4.1 + '@rslint/darwin-x64': 0.4.1 + '@rslint/linux-arm64': 0.4.1 + '@rslint/linux-x64': 0.4.1 + '@rslint/win32-arm64': 0.4.1 + '@rslint/win32-x64': 0.4.1 + jiti: 2.6.1 + + '@rslint/darwin-arm64@0.4.1': + optional: true + + '@rslint/darwin-x64@0.4.1': + optional: true + + '@rslint/linux-arm64@0.4.1': + optional: true + + '@rslint/linux-x64@0.4.1': + optional: true + + '@rslint/win32-arm64@0.4.1': + optional: true + + '@rslint/win32-x64@0.4.1': + optional: true + '@rspack/binding-darwin-arm64@1.7.10': optional: true @@ -750,7 +731,7 @@ snapshots: jiti@2.6.1: {} - nano-staged@1.0.2: {} + picomatch@4.0.4: {} playwright-core@1.59.1: {} @@ -760,6 +741,8 @@ snapshots: optionalDependencies: fsevents: 2.3.2 + prettier@3.8.2: {} + rsbuild-plugin-dts@0.21.0(@rsbuild/core@2.0.0-rc.1(@emnapi/core@1.9.1)(@emnapi/runtime@1.9.1)(core-js@3.47.0))(typescript@6.0.2): dependencies: '@ast-grep/napi': 0.37.0 diff --git a/rslint.config.ts b/rslint.config.ts new file mode 100644 index 0000000..5055b09 --- /dev/null +++ b/rslint.config.ts @@ -0,0 +1,3 @@ +import { defineConfig, ts } from '@rslint/core'; + +export default defineConfig([ts.configs.recommended]); From e5cb617be48b46c797bfbd86f39d16e26639be71 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 13 Apr 2026 11:39:23 +0800 Subject: [PATCH 2/2] fix --- .github/{renovate.json5 => renovate.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{renovate.json5 => renovate.json} (100%) diff --git a/.github/renovate.json5 b/.github/renovate.json similarity index 100% rename from .github/renovate.json5 rename to .github/renovate.json