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
-**Recommended preset**: Includes core architectural rules that enforce modular boundaries
99
+
-**Strict preset**: Includes all rules, including style-related rules like component naming conventions
100
+
85
101
## Rules
86
102
87
103
This plugin provides rules to enforce modular architecture boundaries in Vue.js applications.
@@ -95,6 +111,7 @@ This plugin provides rules to enforce modular architecture boundaries in Vue.js
95
111
-[`vue-modular/enforce-app-structure`](./docs/rules/enforce-app-structure.md): Enforces presence of application infrastructure under `src/app`
96
112
-[`vue-modular/enforce-module-exports`](./docs/rules/enforce-module-exports.md): Ensures modules expose a public API via `index.ts`/`index.js`
97
113
-[`vue-modular/enforce-feature-exports`](./docs/rules/enforce-feature-exports.md): Ensures global features expose a public API via `index.ts`/`index.js`
114
+
-[`vue-modular/component-naming-convention`](./docs/rules/component-naming-convention.md): Enforce consistent naming patterns for Vue components
98
115
99
116
For detailed documentation about rules, see the [Rules Documentation](./docs/rules.md).
|[`vue-modular/no-cross-feature-imports`](./rules/no-cross-feature-imports.md)| Prevents direct imports from deep inside feature folders | Problem | ✅ | ❌ |
10
-
|[`vue-modular/no-cross-module-imports`](./rules/no-cross-module-imports.md)| Prevents imports between different modules | Problem | ✅ | ❌ |
11
-
|[`vue-modular/enforce-src-structure`](./rules/enforce-src-structure.md)| Enforces allowed top-level folders/files in source directory | Problem | ✅ | ❌ |
12
-
|[`vue-modular/enforce-app-structure`](./rules/enforce-app-structure.md)| Enforces presence of application infrastructure under `src/app`| Problem | ✅ | ❌ |
13
-
|[`vue-modular/enforce-module-exports`](./rules/enforce-module-exports.md)| Ensures modules expose a public API via index.ts/index.js | Problem | ✅ | ❌ |
14
-
|[`vue-modular/enforce-feature-exports`](./rules/enforce-feature-exports.md)| Ensures global features expose a public API via index.ts/index.js | Problem | ✅ | ❌ |
|[`vue-modular/no-cross-feature-imports`](./rules/no-cross-feature-imports.md)| Prevents direct imports from deep inside feature folders | Problem | ✅ | ❌ |
10
+
|[`vue-modular/no-cross-module-imports`](./rules/no-cross-module-imports.md)| Prevents imports between different modules | Problem | ✅ | ❌ |
|[`vue-modular/enforce-src-structure`](./rules/enforce-src-structure.md)| Enforces allowed top-level folders/files in source directory | Problem | ✅ | ❌ |
13
+
|[`vue-modular/enforce-app-structure`](./rules/enforce-app-structure.md)| Enforces presence of application infrastructure under `src/app`| Problem | ✅ | ❌ |
14
+
|[`vue-modular/enforce-module-exports`](./rules/enforce-module-exports.md)| Ensures modules expose a public API via index.ts/index.js | Problem | ✅ | ❌ |
15
+
|[`vue-modular/enforce-feature-exports`](./rules/enforce-feature-exports.md)| Ensures global features expose a public API via index.ts/index.js | Problem | ✅ | ❌ |
@@ -21,12 +23,18 @@ Rules that help maintain clean architectural boundaries in your Vue.js applicati
21
23
22
24
-[`vue-modular/no-cross-feature-imports`](./rules/no-cross-feature-imports.md) - Enforces that features should only be imported through their entry points
23
25
-[`vue-modular/no-cross-module-imports`](./rules/no-cross-module-imports.md) - Prevents imports between different modules
24
-
-[`vue-modular/enforce-src-structure`](./rules/enforce-src-structure.md) - Enforces allowed top-level folders/files in source directory
Enforce consistent naming patterns for Vue components.
4
+
5
+
## Rule Details
6
+
7
+
This rule enforces consistent naming conventions for Vue component `name` properties. It ensures that component names follow proper case conventions (PascalCase by default) and optionally validates that filenames match component names.
8
+
9
+
### Examples
10
+
11
+
#### ❌ Incorrect
12
+
13
+
```js
14
+
// Component name should be PascalCase
15
+
exportdefault {
16
+
name:'user-card',
17
+
}
18
+
```
19
+
20
+
```js
21
+
// Filename should match component name (if requireFileNameMatches: true)
22
+
// File: src/components/user-card.js
23
+
exportdefault {
24
+
name:'UserCard',
25
+
}
26
+
```
27
+
28
+
#### ✅ Correct
29
+
30
+
```js
31
+
// PascalCase component name
32
+
exportdefault {
33
+
name:'UserCard',
34
+
}
35
+
```
36
+
37
+
```js
38
+
// Matching filename and component name
39
+
// File: src/components/UserCard.js
40
+
exportdefault {
41
+
name:'UserCard',
42
+
}
43
+
```
44
+
45
+
```js
46
+
// Component without explicit name (allowed by default)
0 commit comments