create-comate-pagebuilder 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-comate-pagebuilder",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "Create a modern, minimalist React + Vite + Tailwind CSS project",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -0,0 +1,12 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(npx eslint:*)",
5
+ "Bash(cat:*)",
6
+ "Bash(npm ls:*)",
7
+ "Bash(npm run lint:*)"
8
+ ],
9
+ "deny": [],
10
+ "ask": []
11
+ }
12
+ }
@@ -0,0 +1,2 @@
1
+ node_modules
2
+ build
@@ -0,0 +1,20 @@
1
+ {
2
+ "parser": "@babel/eslint-parser",
3
+ "parserOptions": {
4
+ "requireConfigFile": false,
5
+ "sourceType": "module",
6
+ "ecmaVersion": "latest",
7
+ "ecmaFeatures": {
8
+ "jsx": true
9
+ },
10
+ "babelOptions": {
11
+ "presets": ["@babel/preset-react"]
12
+ }
13
+ },
14
+ "extends": [
15
+ "@ecomfe/eslint-config",
16
+ "@ecomfe/eslint-config/baidu/default",
17
+ "@ecomfe/eslint-config/baidu/defect",
18
+ "@ecomfe/eslint-config/react"
19
+ ]
20
+ }
@@ -50,6 +50,43 @@ src/
50
50
  └── index.css # 全局样式
51
51
  ```
52
52
 
53
+ ## 🔍 代码规范
54
+
55
+ 项目使用 ESLint 进行代码质量检查,基于 **@ecomfe/eslint-config** 规范(百度前端团队代码规范)。
56
+
57
+ ### 运行 Lint 检查
58
+
59
+ ```bash
60
+ # 检查代码
61
+ npm run lint
62
+
63
+ # 自动修复可修复的问题
64
+ npm run lint:fix
65
+ ```
66
+
67
+ ### 主要规范要点
68
+
69
+ - **缩进**:4 个空格(JavaScript)+ 4 个空格(JSX)
70
+ - **未使用变量**:报错级别(`no-unused-vars: error`)
71
+ - **对象/数组空格**:紧凑风格,不允许空格(`{a: 1}` ✅ / `{ a: 1 }` ❌)
72
+ - **React Hooks**:强制遵循 Hooks 规则
73
+ - **JSX 文件扩展名**:`.js`, `.jsx`, `.tsx` 均可
74
+
75
+ ### 自定义规则
76
+
77
+ 如需调整规则,在 [.eslintrc.json](.eslintrc.json) 中添加 `rules` 字段:
78
+
79
+ ```json
80
+ {
81
+ "rules": {
82
+ "no-unused-vars": "warn", // 改为警告
83
+ "indent": ["error", 2] // 改为 2 空格缩进
84
+ }
85
+ }
86
+ ```
87
+
88
+ > 💡 提示:在 VSCode 中安装 ESLint 插件可实时查看代码问题
89
+
53
90
  ## 🎨 配色系统
54
91
 
55
92
  模板提供标准化的配色结构,在 `tailwind.config.js` 中定义: