Skip to content

Commit fd82985

Browse files
author
苏义超
committed
add frontend code check guide for developer
1 parent 37d2dc3 commit fd82985

File tree

2 files changed

+48
-6
lines changed

2 files changed

+48
-6
lines changed

docs/docs/en/contribute/development-environment-setup.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ Supporting system:
2929

3030
Run `./mvnw clean install -Prelease -Dmaven.test.skip=true`
3131

32-
### Code Style
32+
### Backend Code Style
3333

34-
DolphinScheduler uses `Spotless` for code style and formatting checks.
34+
DolphinScheduler uses `Spotless` for backend code style and formatting checks.
3535
You could run the following command and `Spotless` will automatically fix
36-
the code style and formatting errors for you:
36+
the backend code style and formatting errors for you:
3737

3838
```shell
3939
./mvnw spotless:apply
@@ -54,6 +54,27 @@ pre-commit install
5454

5555
Now, every time you commit your code, `pre-commit` will automatically run `Spotless` to check the code style and formatting.
5656

57+
### Frontend Code Style
58+
59+
DolphinScheduler uses `pnpm` to check and automatically fix frontend code style and formatting issues.
60+
First, navigate to the frontend project directory:
61+
62+
```shell
63+
cd dolphinscheduler-ui
64+
```
65+
66+
Then, run `pnpm run lint` to check and fix frontend code style and formatting issues:
67+
68+
```shell
69+
pnpm run lint
70+
```
71+
72+
Finally, you can run `pnpm run build:prod` to perform a full TypeScript type check, ensuring that only type-safe code is committed.
73+
74+
```shell
75+
pnpm run build:prod
76+
```
77+
5778
### Helm Template Guidelines
5879

5980
After modifying files related to Helm templates, you can use the following command to debug the Helm templates:

docs/docs/zh/contribute/development-environment-setup.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ git clone git@github.com:apache/dolphinscheduler.git
2828

2929
运行 `mvn clean install -Pstaging -Dmaven.test.skip=true`
3030

31-
### 代码风格
31+
### 后端代码风格
3232

33-
DolphinScheduler使用`Spotless`检查并修复代码风格和格式问题
34-
您可以执行如下的命令,`Spotless`将会为您自动检查并修复代码风格和格式问题
33+
DolphinScheduler使用`Spotless`检查并修复后端代码风格和格式问题
34+
您可以执行如下的命令,`Spotless`将会为您自动检查并修复后端代码风格和格式问题
3535

3636
```shell
3737
./mvnw spotless:apply
@@ -51,6 +51,27 @@ pre-commit install
5151

5252
现在,每次您提交代码时,`pre-commit`都会自动运行`Spotless`来检查代码风格和格式。
5353

54+
### 前端代码风格
55+
56+
DolphinScheduler使用`pnpm`检查并修复前端代码风格和格式问题。
57+
首先,进入前端项目文件夹:
58+
59+
```shell
60+
cd dolphinscheduler-ui
61+
```
62+
63+
然后,使用`pnpm run lint`检查并修复前端代码风格和格式问题。
64+
65+
```shell
66+
pnpm run lint
67+
```
68+
69+
最后,可以运行`pnpm run build:prod`来执行完整的 TypeScript 类型检查,确保只有类型正确的代码才能被提交。
70+
71+
```shell
72+
pnpm run build:prod
73+
```
74+
5475
### Helm 模板规范
5576

5677
当您修改了Helm模板相关的文件后, 可以使用如下命令来调试 Helm 模板:

0 commit comments

Comments
 (0)