Skip to content

Commit 6bb376c

Browse files
committed
chore: replace biome with prettier and rslint
1 parent f44804b commit 6bb376c

File tree

14 files changed

+12971
-4492
lines changed

14 files changed

+12971
-4492
lines changed

.husky/pre-commit

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
coverage
2+
compiled
3+
dist
4+
dist-*
5+
doc_build
6+
node_modules
7+
.swc
8+
**/coverage
9+
**/compiled
10+
**/dist
11+
**/dist-*
12+
**/doc_build
13+
**/auto-imports.d.ts
14+
**/components.d.ts
15+
**/@mf-types/**
16+
**/http-import.lock.data/**
17+
**/__snapshots__/**

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"printWidth": 100,
4+
"tabWidth": 2,
5+
"useTabs": false,
6+
"endOfLine": "lf"
7+
}

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"recommendations": ["biomejs.biome"]
2+
"recommendations": ["esbenp.prettier-vscode"]
33
}

.vscode/settings.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@
1313
"files.exclude": {
1414
"**/.DS_Store": true
1515
},
16-
"editor.defaultFormatter": "biomejs.biome",
16+
"editor.defaultFormatter": "esbenp.prettier-vscode",
1717
"mdx.validate.validateFileLinks": "ignore",
1818
"[javascript]": {
19-
"editor.defaultFormatter": "biomejs.biome"
19+
"editor.defaultFormatter": "esbenp.prettier-vscode"
2020
},
2121
"[typescript]": {
22-
"editor.defaultFormatter": "biomejs.biome"
22+
"editor.defaultFormatter": "esbenp.prettier-vscode"
2323
},
24-
"cSpell.words": [
25-
"rstest"
26-
]
24+
"cSpell.words": ["rstest"]
2725
}

AGENTS.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ This file provides guidance for AI coding agents working in this repository.
1313
**The primary goal of each example is to demonstrate "how a specific API achieves a specific effect through specific configuration".**
1414

1515
When creating or modifying examples:
16+
1617
- **Keep it minimal**: Only include code necessary to demonstrate the target feature/API
1718
- **Avoid over-engineering**: Don't add complex business logic that distracts from the core demonstration
1819
- **Focus on the tool, not the ecosystem**: For example, in a test runner example, focus on the test runner's APIs (mocking, assertions, configuration), not on complex DOM manipulation or third-party library integrations
1920
- **One concept per example**: Each example should ideally demonstrate one main feature or configuration pattern
2021
- **Clarity over completeness**: A simple, clear example is better than a comprehensive but confusing one
2122

2223
Example of good vs bad:
24+
2325
```
2426
# Good: Demonstrates rstest's mocking API
2527
- Simple mock function usage
@@ -35,10 +37,12 @@ Example of good vs bad:
3537
## Quick Start (Local)
3638

3739
Prerequisites:
40+
3841
- Node.js per `.nvmrc`
3942
- `corepack` enabled
4043

4144
Common commands:
45+
4246
- Install deps: `corepack enable && pnpm i`
4347
- Build everything: `pnpm run build`
4448
- Build a group:
@@ -50,13 +54,15 @@ Common commands:
5054
- Test Rspack examples: `pnpm run test:rspack`
5155

5256
Working in a single example:
57+
5358
- `cd rspack/basic` (or any other example dir)
5459
- `pnpm i` (workspace install is preferred at repo root)
5560
- `pnpm run dev` / `pnpm run build` / `pnpm run test` (depends on the example)
5661

5762
## Where Things Live
5863

5964
Top-level directories:
65+
6066
- `rspack/`: Rspack examples (often package name prefix `example-*`).
6167
- `rsbuild/`: Rsbuild examples (often package name prefix `rsbuild-*`).
6268
- `rspress/`: Rspress examples (often package name prefix `rspress-*`).
@@ -65,7 +71,7 @@ Top-level directories:
6571

6672
## Coding Conventions
6773

68-
- Formatting and linting: `Biome` is used (see `biome.json`).
74+
- Formatting and linting: `Prettier` and `Rslint` are used (see `.prettierrc` and `rslint.config.ts`).
6975
- Default JS/TS quote style is single quotes.
7076
- Line width is 100.
7177
- Prefer minimal, example-focused changes. This repo is a collection of runnable examples; avoid refactors that reduce clarity.
@@ -87,6 +93,7 @@ Top-level directories:
8793
## Agent Workflow Expectations
8894

8995
When making changes:
96+
9097
- Identify the single example/package impacted.
9198
- Keep changes scoped to that example unless explicitly requested.
9299
- Update configuration consistently with the conventions in that subtree.

biome.json

Lines changed: 0 additions & 78 deletions
This file was deleted.

package.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,30 @@
1111
"build:rspack": "pnpm --filter \"@rspack-example/*\" --stream build",
1212
"build:rspress": "pnpm --filter \"@rspress-example/*\" --stream build",
1313
"bump": "taze -l",
14-
"prepare": "husky",
14+
"lint": "rslint && prettier -c .prettierrc .vscode/extensions.json .vscode/settings.json AGENTS.md package.json pnpm-lock.yaml rslint.config.ts",
15+
"lint:write": "prettier -w .prettierrc .vscode/extensions.json .vscode/settings.json AGENTS.md package.json pnpm-lock.yaml rslint.config.ts",
16+
"prepare": "simple-git-hooks",
1517
"sort-package-json": "npx sort-package-json \"rspack/*/package.json\" \"rsbuild/*/package.json\" \"rspress/*/package.json\" \"rsdoctor/*/package.json\" \"rslib/*/package.json\" \"rstest/*/package.json\"",
1618
"test:rspack": "pnpm --filter \"@rspack-example/*\" --stream test",
1719
"test:rstest": "pnpm --filter \"@rstest-example/*\" --stream test"
1820
},
21+
"simple-git-hooks": {
22+
"pre-commit": "pnpm exec lint-staged && pnpm exec rslint"
23+
},
1924
"lint-staged": {
20-
"*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [
21-
"npx @biomejs/biome check --write --no-errors-on-unmatched"
25+
"*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}": [
26+
"prettier -w"
27+
],
28+
"*.{css,scss,less,md,mdx,html,json,jsonc,yaml,yml,vue}": [
29+
"prettier -w"
2230
]
2331
},
2432
"devDependencies": {
25-
"@biomejs/biome": "^2.3.13",
33+
"@rslint/core": "^0.3.4",
2634
"cross-env": "10.1.0",
27-
"husky": "9.1.7",
2835
"lint-staged": "16.2.7",
36+
"prettier": "^3.8.1",
37+
"simple-git-hooks": "^2.13.1",
2938
"taze": "^19.9.2"
3039
},
3140
"packageManager": "pnpm@10.33.0"

0 commit comments

Comments
 (0)