Skip to content

Commit 269722b

Browse files
committed
release: v0.3.2
1 parent 3342249 commit 269722b

15 files changed

Lines changed: 16865 additions & 18903 deletions

.eslintrc.json

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

.husky/pre-push

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env sh
2+
npm run verify:ci

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ Vite 开发端口固定为 `9754`,与 `src-tauri/tauri.conf.json` 的 `devUrl`
8181

8282
## 验证命令
8383

84+
```bash
85+
npm run verify:ci
86+
```
87+
88+
`verify:ci` 会按 GitHub CI 的顺序执行 `npm ci --ignore-scripts`、lint、test 和 Vite build,用来在推送前提前发现 lockfile 失配与静态检查问题。
89+
90+
也可以单独运行:
91+
8492
```bash
8593
npm run lint
8694
npm test
@@ -104,11 +112,11 @@ npm run tauri:build
104112
常规开发建议先确保本地通过:
105113

106114
```bash
107-
npm run lint
108-
npm test
109-
npm run build:vite
115+
npm run verify:ci
110116
```
111117

118+
项目使用 Husky 配置了 `pre-push` hook。执行过 `npm install` 后,`git push` 会自动先运行 `npm run verify:ci`,失败时不会推送到 GitHub。
119+
112120
## 版本与发版
113121

114122
版本号以 `package.json` 为准,并通过 `npm version` 自动同步到:

eslint.config.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
const js = require("@eslint/js");
2+
const globals = require("globals");
3+
const react = require("eslint-plugin-react");
4+
const reactHooks = require("eslint-plugin-react-hooks");
5+
6+
module.exports = [
7+
{
8+
ignores: ["dist/**", "node_modules/**", "src-tauri/**"],
9+
},
10+
js.configs.recommended,
11+
{
12+
files: ["src/**/*.{js,jsx}"],
13+
languageOptions: {
14+
ecmaVersion: 2021,
15+
sourceType: "module",
16+
parserOptions: {
17+
ecmaFeatures: {
18+
jsx: true,
19+
},
20+
},
21+
globals: {
22+
...globals.browser,
23+
...globals.node,
24+
...globals.vitest,
25+
},
26+
},
27+
plugins: {
28+
react,
29+
"react-hooks": reactHooks,
30+
},
31+
settings: {
32+
react: {
33+
version: "detect",
34+
},
35+
},
36+
rules: {
37+
...react.configs.recommended.rules,
38+
...reactHooks.configs.recommended.rules,
39+
"no-console": "error",
40+
"no-undef": "error",
41+
"react/prop-types": "off",
42+
"react/react-in-jsx-scope": "off",
43+
"react-hooks/refs": "off",
44+
"react-hooks/set-state-in-effect": "off",
45+
},
46+
},
47+
{
48+
files: ["src/services/**/*.js", "src/config/**/*.js", "src/utils/**/*.js"],
49+
rules: {
50+
"no-restricted-imports": [
51+
"error",
52+
{
53+
patterns: [
54+
{
55+
group: ["react", "react-dom", "antd"],
56+
message:
57+
"React/UI imports are forbidden in services/, config/, and utils/. Keep these layers pure.",
58+
},
59+
],
60+
},
61+
],
62+
},
63+
},
64+
];

0 commit comments

Comments
 (0)