@hestjs/eslint-config 0.1.0 → 0.1.1
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/README.md +26 -11
- package/package.json +4 -4
package/README.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
|
-
# @
|
1
|
+
# @hestjs/eslint-config
|
2
2
|
|
3
|
-
|
3
|
+
<div align="center">
|
4
|
+
|
5
|
+

|
6
|
+
|
7
|
+
**ESLint 配置包,为 HestJS Framework 项目提供统一的代码风格和质量检查。**
|
8
|
+
|
9
|
+
[](https://www.npmjs.com/package/@hest/logger)
|
10
|
+
[](https://www.npmjs.com/package/@hest/logger)
|
11
|
+
[](https://github.com/aqz236/hestjs-eslint-config/blob/main/LICENSE)
|
12
|
+
[](https://www.typescriptlang.org/)
|
13
|
+
|
14
|
+
</div>
|
4
15
|
|
5
16
|
## 特性
|
6
17
|
|
@@ -14,7 +25,7 @@ ESLint 配置包,为 Eve Framework 项目提供统一的代码风格和质量
|
|
14
25
|
## 安装
|
15
26
|
|
16
27
|
```bash
|
17
|
-
bun add -D @
|
28
|
+
bun add -D @hestjs/eslint-config
|
18
29
|
```
|
19
30
|
|
20
31
|
## 使用方法
|
@@ -25,7 +36,7 @@ bun add -D @eve-tools/eslint-config eslint typescript
|
|
25
36
|
|
26
37
|
```typescript
|
27
38
|
// eslint.config.ts
|
28
|
-
import eveConfig from '@
|
39
|
+
import eveConfig from '@hestjs/eslint-config';
|
29
40
|
|
30
41
|
export default eveConfig;
|
31
42
|
```
|
@@ -34,7 +45,7 @@ export default eveConfig;
|
|
34
45
|
|
35
46
|
```typescript
|
36
47
|
// eslint.config.ts
|
37
|
-
import baseConfig from '@
|
48
|
+
import baseConfig from '@hestjs/eslint-config/base';
|
38
49
|
|
39
50
|
export default baseConfig;
|
40
51
|
```
|
@@ -43,7 +54,7 @@ export default baseConfig;
|
|
43
54
|
|
44
55
|
```typescript
|
45
56
|
// eslint.config.ts
|
46
|
-
import reactConfig from '@
|
57
|
+
import reactConfig from '@hestjs/eslint-config/react';
|
47
58
|
|
48
59
|
export default reactConfig;
|
49
60
|
```
|
@@ -52,7 +63,7 @@ export default reactConfig;
|
|
52
63
|
|
53
64
|
```typescript
|
54
65
|
// eslint.config.ts
|
55
|
-
import vueConfig from '@
|
66
|
+
import vueConfig from '@hestjs/eslint-config/vue';
|
56
67
|
|
57
68
|
export default vueConfig;
|
58
69
|
```
|
@@ -61,7 +72,7 @@ export default vueConfig;
|
|
61
72
|
|
62
73
|
```typescript
|
63
74
|
// eslint.config.ts
|
64
|
-
import eveConfig from '@
|
75
|
+
import eveConfig from '@hestjs/eslint-config';
|
65
76
|
|
66
77
|
export default [
|
67
78
|
...eveConfig,
|
@@ -80,7 +91,7 @@ export default [
|
|
80
91
|
|
81
92
|
```typescript
|
82
93
|
// eslint.config.ts
|
83
|
-
import eveConfig from '@
|
94
|
+
import eveConfig from '@hestjs/eslint-config/source';
|
84
95
|
|
85
96
|
export default eveConfig;
|
86
97
|
```
|
@@ -89,7 +100,7 @@ export default eveConfig;
|
|
89
100
|
|
90
101
|
```typescript
|
91
102
|
// eslint.config.ts
|
92
|
-
import reactConfig from '@
|
103
|
+
import reactConfig from '@hestjs/eslint-config/react/source';
|
93
104
|
|
94
105
|
export default reactConfig;
|
95
106
|
```
|
@@ -98,7 +109,7 @@ export default reactConfig;
|
|
98
109
|
|
99
110
|
```javascript
|
100
111
|
// eslint.config.js (降级方案)
|
101
|
-
import eveConfig from '@
|
112
|
+
import eveConfig from '@hestjs/eslint-config';
|
102
113
|
|
103
114
|
export default eveConfig;
|
104
115
|
```
|
@@ -106,6 +117,7 @@ export default eveConfig;
|
|
106
117
|
## 包含的规则
|
107
118
|
|
108
119
|
### 基础规则
|
120
|
+
|
109
121
|
- 强制使用单引号
|
110
122
|
- 要求分号
|
111
123
|
- 禁止多个空行
|
@@ -113,6 +125,7 @@ export default eveConfig;
|
|
113
125
|
- 更多代码风格规则...
|
114
126
|
|
115
127
|
### TypeScript 规则
|
128
|
+
|
116
129
|
- 优先使用类型导入
|
117
130
|
- 禁止使用 any 类型(警告)
|
118
131
|
- 强制使用可选链操作符
|
@@ -120,11 +133,13 @@ export default eveConfig;
|
|
120
133
|
- 更多 TypeScript 最佳实践...
|
121
134
|
|
122
135
|
### React 规则
|
136
|
+
|
123
137
|
- React Hooks 规则
|
124
138
|
- React Refresh 规则
|
125
139
|
- JSX 最佳实践
|
126
140
|
|
127
141
|
### Vue 规则
|
142
|
+
|
128
143
|
- Vue 3 推荐规则
|
129
144
|
- 组件命名规范
|
130
145
|
- 模板语法检查
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hestjs/eslint-config",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.1",
|
4
4
|
"description": "ESLint configuration",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/eslint.config.js",
|
@@ -85,13 +85,13 @@
|
|
85
85
|
],
|
86
86
|
"author": "Hest Team",
|
87
87
|
"license": "MIT",
|
88
|
-
"homepage": "https://
|
88
|
+
"homepage": "https://github.com/aqz236/hestjs-eslint-config#readme",
|
89
89
|
"repository": {
|
90
90
|
"type": "git",
|
91
|
-
"url": "https://github.com/
|
91
|
+
"url": "git+https://github.com/aqz236/hestjs-eslint-config.git",
|
92
92
|
"directory": "packages/@hestjs/eslint-config"
|
93
93
|
},
|
94
94
|
"bugs": {
|
95
|
-
"url": "https://github.com/
|
95
|
+
"url": "https://github.com/aqz236/hestjs-eslint-config/issues"
|
96
96
|
}
|
97
97
|
}
|