Skip to content

chore: migrate to Rslint and Prettier#53

Merged
chenjiahan merged 1 commit intomainfrom
chenjiahan/chore-rslint-prettier
Apr 28, 2026
Merged

chore: migrate to Rslint and Prettier#53
chenjiahan merged 1 commit intomainfrom
chenjiahan/chore-rslint-prettier

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

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 lint
  • pnpm run build and pnpm test were attempted locally, but both are blocked by the local macOS Rspack native binding code-signature load failure in @rspack/binding-darwin-arm64.

@chenjiahan chenjiahan force-pushed the chenjiahan/chore-rslint-prettier branch from 3e2ed56 to 3d0c8dd Compare April 28, 2026 09:44
@chenjiahan chenjiahan marked this pull request as ready for review April 28, 2026 10:37
Copilot AI review requested due to automatic review settings April 28, 2026 10:37
@chenjiahan chenjiahan merged commit 7129f32 into main Apr 28, 2026
7 checks passed
@chenjiahan chenjiahan deleted the chenjiahan/chore-rslint-prettier branch April 28, 2026 10:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread package.json
"prepare": "simple-git-hooks && npm run build",
"lint": "rslint && prettier -c .",
"lint:write": "rslint --fix && prettier -w .",
"prepare": "simple-git-hooks && pnpm run build",
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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.

Suggested change
"prepare": "simple-git-hooks && pnpm run build",
"prepare": "simple-git-hooks && npm run build",

Copilot uses AI. Check for mistakes.
Comment thread package.json
Comment on lines 29 to 31
"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"
},
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants