chore: migrate to Rslint and Prettier#53
Conversation
3e2ed56 to
3d0c8dd
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Migrates the repo’s linting/formatting toolchain from Biome to Rslint + Prettier, aligning configs and editor/CI integration and reformatting code accordingly.
Changes:
- Replace Biome with Rslint + Prettier (configs, deps, scripts, hooks).
- Update VS Code recommendations/settings and workflow YAML quoting.
- Apply Prettier formatting across source, tests, configs, and docs.
Reviewed changes
Copilot reviewed 12 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/selfsigned-options/rsbuild.config.ts | Prettier reformat of test config. |
| test/selfsigned-options/index.test.ts | Prettier reformat of test code. |
| test/output-path/rsbuild.config.ts | Prettier reformat of test config. |
| test/output-path/index.test.ts | Prettier reformat of test code. |
| test/filename/rsbuild.config.ts | Prettier reformat of test config. |
| test/filename/index.test.ts | Prettier reformat of test code. |
| test/basic/rsbuild.config.ts | Prettier reformat of test config. |
| test/basic/index.test.ts | Prettier reformat of test code. |
| src/util.ts | Prettier reformat; minor catch syntax change. |
| src/index.ts | Prettier reformat of exported types/plugin factory. |
| rslint.config.ts | Add Rslint configuration. |
| rslib.config.ts | Prettier reformat of build config. |
| playground/rsbuild.config.ts | Prettier reformat of playground config. |
| playground/package.json | Prettier reformat of playground package.json. |
| package.json | Swap scripts/deps/hooks from Biome+nano-staged to Rslint+Prettier. |
| biome.json | Remove Biome configuration. |
| README.md | Update code samples to single quotes (Prettier). |
| .vscode/settings.json | Remove Biome formatter settings; add spelling word. |
| .vscode/extensions.json | Recommend Rslint + Prettier extensions. |
| .prettierrc | Add Prettier config (singleQuote). |
| .prettierignore | Add ignore rules for artifacts. |
| .github/workflows/test.yml | Prettier-driven quoting change. |
| .github/workflows/release.yml | Prettier-driven quoting change. |
| .github/renovate.json5 | Prettier-driven JSON5 formatting change. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "prepare": "simple-git-hooks && npm run build", | ||
| "lint": "rslint && prettier -c .", | ||
| "lint:write": "rslint --fix && prettier -w .", | ||
| "prepare": "simple-git-hooks && pnpm run build", |
There was a problem hiding this comment.
"prepare"is executed by npm during installs from git (and in some publish flows). Hard-codingpnpmhere can break consumers/environments that runnpm installbut don’t havepnpmavailable on PATH. Prefer usingnpm run build` (npm is guaranteed in that context), or otherwise ensure the script is package-manager-agnostic (e.g., via a node script) if you want to keep pnpm as the primary dev tool.
| "prepare": "simple-git-hooks && pnpm run build", | |
| "prepare": "simple-git-hooks && npm run build", |
| "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" | ||
| }, |
There was a problem hiding this comment.
Running lint:write on pre-commit will format/lint the entire repository, which can (1) significantly slow down commits and (2) modify files that aren’t staged, leaving the working tree dirty and potentially surprising the committer. Consider switching the hook back to a staged-files-only workflow (e.g., lint-staged/nano-staged) or wiring the hook to only pass staged file paths to Prettier/Rslint.
Summary
This PR migrates the repository lint and formatting toolchain from Biome to Rslint + Prettier to align with rsbuild-plugin-template. It adds Rslint and Prettier config, updates lint scripts and git hooks, removes Biome/nano-staged, updates VS Code recommendations, and applies Prettier formatting across tracked files.
Validation
pnpm run lintpnpm run buildandpnpm testwere attempted locally, but both are blocked by the local macOS Rspack native binding code-signature load failure in@rspack/binding-darwin-arm64.