You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: enhance naming conventions for Vue modular architecture
- Updated the enforce-naming-convention rule to include validation for entity, routes, and menu file naming conventions.
- Added specific checks for PascalCase filenames for entities and exact naming for routes and menu files.
- Modified the getFileType function to recognize entities, routes, and menu files.
- Updated tests to cover new naming conventions for entities, routes, and menu files, ensuring compliance with the updated rules.
-**Routes** → Must be exactly `routes.ts` in modules
16
+
-**Menu** → Must be exactly `menu.ts` in modules
14
17
15
18
**Note**: This rule is designed for modern Vue applications where components typically don't have explicit `name` properties (especially with `<script setup>`). The rule primarily validates **filenames** rather than component names.
16
19
@@ -70,6 +73,30 @@ export class AuthService {
70
73
}
71
74
```
72
75
76
+
```js
77
+
// File: src/entities/user.ts
78
+
// Entity files should use PascalCase
79
+
exportinterfaceUser {
80
+
// entity definition
81
+
}
82
+
```
83
+
84
+
```js
85
+
// File: src/modules/auth/Routes.ts
86
+
// Module routes file must be exactly 'routes.ts'
87
+
exportdefault [
88
+
// route definitions
89
+
]
90
+
```
91
+
92
+
```js
93
+
// File: src/modules/users/navigation.ts
94
+
// Module menu file must be exactly 'menu.ts'
95
+
exportconstmoduleNavigation= [
96
+
// menu definitions
97
+
]
98
+
```
99
+
73
100
#### ✅ Correct
74
101
75
102
```vue
@@ -133,7 +160,7 @@ export function fetchData() {
133
160
```
134
161
135
162
```js
136
-
// File: src/services/auth.api.ts
163
+
// File: src/services/auth.ts
137
164
// Proper service naming (starts with lowercase)
138
165
exportclassAuthAPI {
139
166
// service implementation
@@ -143,7 +170,7 @@ export class AuthAPI {
143
170
```js
144
171
// File: src/services/index.ts
145
172
// Proper service naming (starts with lowercase)
146
-
export*from'./auth.api'
173
+
export*from'./auth'
147
174
export*from'./frameMessages'
148
175
```
149
176
@@ -155,6 +182,43 @@ export function sendMessage() {
0 commit comments