Skip to content

Commit 0834a46

Browse files
committed
chore: migrate linting to rslint and prettier
1 parent c36213d commit 0834a46

23 files changed

Lines changed: 150 additions & 189 deletions

.github/renovate.json5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": ["github>rstackjs/renovate"]
2+
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
3+
extends: ['github>rstackjs/renovate'],
44
}

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
# Run `npm run bump` to bump the version and create a git tag.
66
push:
77
tags:
8-
- "v*"
8+
- 'v*'
99

1010
workflow_dispatch:
1111

@@ -46,4 +46,4 @@ jobs:
4646
- name: Create GitHub Release
4747
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1
4848
with:
49-
generateReleaseNotes: "true"
49+
generateReleaseNotes: 'true'

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
3333
with:
3434
node-version: 24.15.0
35-
cache: "pnpm"
35+
cache: 'pnpm'
3636

3737
- name: Install Dependencies
3838
run: pnpm install && npx playwright install

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore artifacts:
2+
dist
3+
pnpm-lock.yaml

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.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": ["rstack.rslint", "esbenp.prettier-vscode"]
33
}

.vscode/settings.json

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
11
{
22
"search.useIgnoreFiles": true,
3-
"[json]": {
4-
"editor.defaultFormatter": "biomejs.biome"
5-
},
6-
"[typescript]": {
7-
"editor.defaultFormatter": "biomejs.biome"
8-
},
9-
"[javascript]": {
10-
"editor.defaultFormatter": "biomejs.biome"
11-
},
12-
"[javascriptreact]": {
13-
"editor.defaultFormatter": "biomejs.biome"
14-
},
15-
"[css]": {
16-
"editor.defaultFormatter": "esbenp.prettier-vscode"
17-
}
3+
"editor.defaultFormatter": "esbenp.prettier-vscode"
184
}

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Register the plugin in `rsbuild.config.ts`:
2525

2626
```ts
2727
// rsbuild.config.ts
28-
import { pluginWorkspaceDev } from "rsbuild-plugin-workspace-dev";
28+
import { pluginWorkspaceDev } from 'rsbuild-plugin-workspace-dev';
2929

3030
export default {
3131
plugins: [pluginWorkspaceDev()],
@@ -84,9 +84,11 @@ Whether a sub-project has finished starting is determined by matching sub-projec
8484
## Options
8585

8686
### projects
87+
8788
Configure how sub-projects are started and define custom log matching logic.
8889

8990
- Type:
91+
9092
```
9193
type projects = {
9294
// The key is the name of the sub-project's package.json file.
@@ -166,6 +168,7 @@ Set the directory where the workspace file resides. The default is the current p
166168
## Frequently Asked Questions
167169

168170
### Project startup stuck
171+
169172
Stuck may be due to slow sub-project builds, etc. The lack of log output is because, by default, sub-project logs are output all at once after startup (to avoid interleaving sub-project logs). You can enable debug mode by adding an environment variable, which will allow sub-project logs to be output in real time.
170173

171174
```
@@ -178,7 +181,7 @@ If some sub-projects don't need to start, simply configure `skip: true` for the
178181

179182
```ts
180183
// rsbuild.config.ts
181-
import { pluginWorkspaceDev } from "rsbuild-plugin-workspace-dev";
184+
import { pluginWorkspaceDev } from 'rsbuild-plugin-workspace-dev';
182185

183186
export default {
184187
plugins: [

README.zh-CN.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pnpm add rsbuild-plugin-workspace-dev -D
2323

2424
```ts
2525
// rsbuild.config.ts
26-
import { pluginWorkspaceDev } from "rsbuild-plugin-workspace-dev";
26+
import { pluginWorkspaceDev } from 'rsbuild-plugin-workspace-dev';
2727

2828
export default {
2929
plugins: [pluginWorkspaceDev()],
@@ -66,22 +66,27 @@ lib2 依赖了 lib3:
6666
}
6767
}
6868
```
69+
6970
此时在 app 下执行 `pnpm dev` 后,会按照拓扑顺序先启动 lib1 和 lib3,再启动 lib2,最后启动 app。此处启动 lib 指的是执行 lib 的 dev 命令
71+
7072
```json
7173
{
7274
"scripts": {
7375
"dev": "rslib -w"
7476
}
7577
}
7678
```
79+
7780
识别子项目是否启动完成是通过匹配子项目日志实现的,默认支持匹配 Rslib、tsup 子项目,同时支持手动配置 match 匹配日志。
7881

7982
## 选项
8083

8184
### projects
85+
8286
用于子项目的启动项配置和自定义日志匹配逻辑。
8387

8488
- **类型:**
89+
8590
```
8691
type projects = {
8792
// key 为子项目 package.json name
@@ -116,7 +121,6 @@ pluginWorkspaceDev({
116121
})
117122
```
118123

119-
120124
### startCurrent
121125

122126
- **类型:** `boolean`
@@ -125,6 +129,7 @@ pluginWorkspaceDev({
125129
插件是否同时启动当前项目,默认值为 `false`。通常无需手动配置,当前项目通常由用户手动执行 dev 启动,无需插件干预。
126130

127131
考虑如下场景,docs 和 lib 是在同一个项目中,而 docs 需要调试 lib 的产物,此时需要启动 `pnpm doc` 命令,而 lib 则需要启动 `pnpm dev` 命令,配置该选项到 rspress 配置中后,启动 `pnpm doc` 时会自动执行 `pnpm dev` 命令,用于启动 lib 子项目。
132+
128133
```
129134
├── docs
130135
│ └── index.mdx
@@ -134,6 +139,7 @@ pluginWorkspaceDev({
134139
├── rslib.config.ts
135140
├── rspress.config.ts
136141
```
142+
137143
```
138144
"scripts": {
139145
"dev": "rslib -w",
@@ -155,21 +161,23 @@ pluginWorkspaceDev({
155161

156162
用于配置 workspace 文件目录,默认值为当前项目目录,通常无需配置。
157163

158-
159164
## 常见问题
160165

161166
### 启动项目时卡住
167+
162168
卡住可能是因为子项目构建过慢等原因,没有日志输出是因为默认情况下子项目日志是启动完成后一次性输出的(为了避免子项目日志混和在一起交错输出),可以通过添加环境变量来开启调试模式,这会让子项目的日志实时输出。
169+
163170
```
164171
DEBUG=rsbuild pnpm dev
165172
```
166173

167174
### 某些项目无需启动
175+
168176
如果某些子项目不需要启动,只需要在 `rsbuild.config.ts` 中给指定项目配置 `skip: true` 即可。
169177

170178
```ts
171179
// rsbuild.config.ts
172-
import { pluginWorkspaceDev } from "rsbuild-plugin-workspace-dev";
180+
import { pluginWorkspaceDev } from 'rsbuild-plugin-workspace-dev';
173181

174182
export default {
175183
plugins: [
@@ -184,7 +192,6 @@ export default {
184192
};
185193
```
186194

187-
188195
## License
189196

190197
[MIT](./LICENSE).

biome.json

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

0 commit comments

Comments
 (0)