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
Copy file name to clipboardExpand all lines: docs/rules/filename-naming-convention.md
+27-25Lines changed: 27 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -45,38 +45,42 @@ In addition to the built-in naming conventions, you can also set custom naming p
45
45
...
46
46
```
47
47
48
-
**Tip:** To selecte all your `js` files, your can use the glob expression `**/*.js`.
48
+
**Tip 1:** To selecte all your `js` files, your can use the glob expression `**/*.js`.
49
49
50
-
:warning::warning::warning:
50
+
**Tip 2:** v1 versions have the legacy support for selecting target files based on their extensions. This legacy support has been removed since v2.0.0. Please select your target files by their file path. For example, using `**/*.js` instead of `*.js` to select all `js` files.
51
51
52
-
**v1 versions have the legacy support for selecting target files based on their extensions. This legacy support has been removed since v2.0.0. Please select your target files by their file path. For example, using `**/*.js` instead of `*.js` to select all `js` files.**
52
+
### Prefined match syntax
53
53
54
+
Prefined match syntax allow you to capture specific part of the target file pattern and use it in your naming convention pattern. This syntax is particularly useful when you want to make a file to be named the same as its parent folder.
54
55
55
-
### Options
56
+
To use prefined match in your rule set, you can use the `<index>` syntax. The index refers to the position where the glob matcher occurs in the target file pattern expression, starting with `0`. Read more about glob capture groups in the [micromatch documentation](https://github.com/micromatch/micromatch#capture).
Examples of **correct** filename with path for this rule:
72
+
```sh
73
+
src/Portal/index.ts
74
+
src/Portal/Portal.test.tsx
75
+
src/Portal/Portal.tsx
76
+
src/Portal/Portal.types.ts
73
77
```
74
78
75
-
#### using capture groups
79
+
###Options
76
80
77
-
You can use glob capture groups in you rule set using the `<index>` syntax. Read more about glob capture groups in the [micromatch documentation](https://github.com/micromatch/micromatch#capture).
81
+
#### naming pattern object
78
82
79
-
For example the following rule will only allow a file to be named the same as its parent folder :
83
+
You need to specify a different naming pattern for different file. The plugin will only check files you explicitly selected:
0 commit comments