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
|[vue-modular/file-component-naming](./docs/rules/file-component-naming.md)| All Vue components must use PascalCase naming (e.g., `UserForm.vue`, `ProductList.vue`). |
93
+
| vue-modular/file-ts-naming | All TypeScript files must use camelCase naming (e.g., `useAuth.ts`, `userApi.ts`). |
94
+
| vue-modular/folder-kebab-case | All folders must use kebab-case naming (e.g., `user-management/`, `auth/`). |
95
+
| vue-modular/feature-index-required | Each feature folder must contain an `index.ts` file as its public API. |
96
+
| vue-modular/components-index-required | All `components/` folders must contain an `index.ts` file for component exports. |
97
+
| vue-modular/shared-ui-index-required | The `shared/ui/` folder must contain an `index.ts` file for UI component exports. |
Enforce PascalCase filenames for Vue Single File Components (.vue).
4
+
5
+
## Rule Details
6
+
7
+
This rule requires that component filenames use PascalCase (for example `MyButton.vue`) to make component names predictable and consistent across a project.
8
+
9
+
By default the rule only applies to files under the `src` directory. It supports an `ignore` option with glob patterns to skip files or folders.
10
+
11
+
Examples of incorrect and correct code for this rule are below.
12
+
13
+
### Incorrect
14
+
15
+
```vue
16
+
<!-- File: src/components/user-card.vue -->
17
+
<!-- Filename should be PascalCase -->
18
+
<script setup>
19
+
// component implementation
20
+
</script>
21
+
```
22
+
23
+
```vue
24
+
<!-- File: src/shared/ui/cgs-icon.vue -->
25
+
<script>
26
+
export default {}
27
+
</script>
28
+
```
29
+
30
+
### Correct
31
+
32
+
```vue
33
+
<!-- File: src/components/UserCard.vue -->
34
+
<script setup>
35
+
// component implementation
36
+
</script>
37
+
```
38
+
39
+
```vue
40
+
<!-- File: src/shared/ui/CgsIcon.vue -->
41
+
<script>
42
+
export default {}
43
+
</script>
44
+
```
45
+
46
+
## Options
47
+
48
+
This rule accepts an object with the following properties:
49
+
50
+
-`src` (string, default: `"src"`) - base source directory to scope the rule. When set, files outside this directory are ignored.
51
+
-`ignore` (string[], default: `[]`) - array of glob patterns (minimatch) to ignore. Patterns are matched against both the absolute file path and the project-relative path.
- The `src` option is applied by checking whether the file path contains the configured segment (for example `src` or `app`). If the segment is not present the file is ignored.
71
+
- The `ignore` patterns use `minimatch` semantics and are matched against the absolute filename and the path relative to the repository root.
72
+
73
+
## When Not To Use
74
+
75
+
- If your project convention requires a different casing (for example `kebab-case` filenames) you should not enable this rule.
76
+
- If your build tooling rewrites or normalizes component filenames automatically, this rule may produce false positives.
0 commit comments