Skip to content

Commit 7001410

Browse files
Support automations for website, including ping, secret change, and account verification
2 parents a997358 + ae0b357 commit 7001410

File tree

15 files changed

+1299
-358
lines changed

15 files changed

+1299
-358
lines changed

.prettierignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Dependencies
2+
node_modules/
3+
dist/
4+
build/
5+
lina/
6+
7+
# Logs
8+
*.log
9+
logs/
10+
11+
# Runtime data
12+
pids/
13+
*.pid
14+
*.seed
15+
16+
# Coverage directory used by tools like istanbul
17+
coverage/
18+
19+
# Generated files
20+
*.min.js
21+
*.min.css
22+
23+
# Package files
24+
*.tgz
25+
*.tar.gz
26+
27+
# Lock files
28+
package-lock.json
29+
yarn.lock
30+
31+
# Build outputs
32+
*.map
33+
34+
# Config files that shouldn't be formatted
35+
.eslintrc.js
36+
babel.config.js
37+
jest.config.js
38+
vue.config.js
39+
postcss.config.js
40+
41+
# Theme files
42+
src/styles/fonts/
43+
public/fonts/
44+
lina/fonts/
45+
46+
# Assets
47+
src/assets/
48+
public/
49+
50+
# Mock data
51+
mock/
52+
53+
# Test files
54+
tests/
55+
56+
# Documentation
57+
*.md

.prettierrc

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

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM jumpserver/lina-base:20250805_081024 AS stage-build
1+
FROM jumpserver/lina-base:20250905_085804 AS stage-build
22

33
ARG VERSION
44
ENV VERSION=$VERSION

PRETTIER.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Prettier 配置说明
2+
3+
本项目已配置 Prettier 代码格式化工具,**仅在保存时自动格式化**,不进行批量格式化,以保持现有代码风格。
4+
5+
## 配置文件
6+
7+
- `.prettierrc` - Prettier 配置文件
8+
- `.prettierignore` - 忽略格式化的文件列表
9+
- `.vscode/settings.json` - VSCode 编辑器配置(保存时自动格式化)
10+
- `.vscode/extensions.json` - 推荐的 VSCode 扩展
11+
12+
## 使用方法
13+
14+
### 1. 安装依赖
15+
项目已安装以下依赖:
16+
- `prettier@^2.8.8` - Prettier 核心
17+
- `eslint-plugin-prettier@^3.1.4` - ESLint 与 Prettier 集成
18+
- `eslint-config-prettier@^6.15.0` - 禁用与 Prettier 冲突的 ESLint 规则
19+
20+
### 2. 命令行使用
21+
22+
```bash
23+
# ESLint 检查和修复
24+
npm run fix
25+
```
26+
27+
**注意**:本项目配置为仅在保存时自动格式化,不提供批量格式化命令。
28+
29+
### 3. VSCode 编辑器配置
30+
31+
确保安装了推荐的扩展:
32+
- Prettier - Code formatter (esbenp.prettier-vscode)
33+
- ESLint (dbaeumer.vscode-eslint)
34+
- Vetur (octref.vetur)
35+
36+
配置已设置为保存时自动格式化。
37+
38+
### 4. Git 提交钩子
39+
40+
项目使用 `husky``lint-staged` 在提交时进行代码检查:
41+
- 提交时运行 ESLint 检查和修复
42+
- 不进行批量格式化,保持原有代码风格
43+
44+
## Prettier 配置说明
45+
46+
```json
47+
{
48+
"semi": false, // 不使用分号
49+
"singleQuote": true, // 使用单引号
50+
"tabWidth": 0, // 不使用缩进
51+
"useTabs": false, // 使用空格而不是制表符
52+
"trailingComma": "none", // 不使用尾随逗号
53+
"printWidth": 100, // 行宽 100 字符
54+
"bracketSpacing": true, // 对象括号内有空格
55+
"arrowParens": "avoid", // 箭头函数单参数时不使用括号
56+
"endOfLine": "lf", // 使用 LF 换行符
57+
"vueIndentScriptAndStyle": false // Vue 文件中 script 和 style 标签不缩进
58+
}
59+
```
60+
61+
## 常见问题
62+
63+
### Q: 如何临时禁用格式化?
64+
A: 使用注释:
65+
```javascript
66+
// prettier-ignore
67+
const uglyCode = {
68+
a:1,b:2
69+
}
70+
```
71+
72+
### Q: 如何添加文件到忽略列表?
73+
A: 编辑 `.prettierignore` 文件,添加文件或目录路径。
74+
75+
### Q: VSCode 保存时没有自动格式化?
76+
A: 检查是否安装了 Prettier 扩展,并确认 `.vscode/settings.json` 配置正确。

0 commit comments

Comments
 (0)