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: README.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -45,8 +45,8 @@ Then configure the rules you want to use under the rules section.
45
45
"check-file/filename-naming-convention":[
46
46
"error",
47
47
{
48
-
"*.{jsx,tsx}":"CAMEL_CASE",
49
-
"*.{js,ts}":"KEBAB_CASE"
48
+
"**/*.{jsx,tsx}":"CAMEL_CASE",
49
+
"**/*.{js,ts}":"KEBAB_CASE"
50
50
}
51
51
],
52
52
"check-file/no-index":"error",
@@ -64,6 +64,6 @@ Then configure the rules you want to use under the rules section.
64
64
## Supported Rules
65
65
66
66
-[check-file/folder-match-with-fex](docs/rules/folder-match-with-fex.md): Enforce a consistent naming pattern for the folder of the specified file extension
67
-
-[check-file/filename-naming-convention](docs/rules/filename-naming-convention.md): Enforce a consistent naming pattern for the filename of the specified file extension
67
+
-[check-file/filename-naming-convention](docs/rules/filename-naming-convention.md): Enforce a consistent naming pattern for the filename of the specified file
68
68
-[check-file/no-index](docs/rules/no-index.md): A file cannot be named "index"
69
69
-[check-file/folder-naming-convention](docs/rules/folder-naming-convention.md): Enforce a consistent naming pattern for the name of the specified folder
Examples of **incorrect** filename with path for this rule:
28
28
```sh
29
-
calculate-price.js
30
-
CalculatePrice.js
31
-
calculate_price.js
32
-
calculateprice.js
29
+
src/services/downloadService.js
30
+
src/services/downloadservice.js
31
+
src/services/download-service.js
32
+
src/services/download_service.js
33
33
```
34
34
35
-
Examples of **correct** filename for this rule:
35
+
Examples of **correct** filename with path for this rule:
36
36
```sh
37
-
calculatePrice.js
37
+
src/services/DownloadService.js
38
+
src/download-service.js // this file is not be selected by the target pattern, so it is skipped
38
39
```
39
40
40
41
In addition to the built-in naming conventions, you can also set custom naming patterns using glob match syntax. The following code shows an example of how to ensure that all your `js` files are named begin with `__`:
**Tip:** To exclude some config and test/spec files for all your `js` files, such as `babel.config.js` and `index.test.js`, use the glob expression `'!(*.spec|*.test|*.config).js'` to match the target files. This will exclude all `js` files with filenames containing `.spec`, `.test` or `.config`.
48
+
**Tip 1:** To exclude some config and test/spec files for all your `js` files, such as `babel.config.js` and `index.test.js`, use the glob expression `'**/!(*.spec|*.test|*.config).js'` to match the target files. This will exclude all `js` files with filenames containing `.spec`, `.test` or `.config`.
49
+
50
+
**Tip 2:** To selecte all your `js` files, your can use the glob expression `**/*.js`.
51
+
52
+
:warning::warning::warning:
53
+
**Versions below v1.2.0 can only select files by using their extensions. All `v1` versions will have this feature, but is will be removed in the future. Please select your target files by the file path. For example, using `**/*.js` instead of `*.js` to select all `js` files.**
54
+
48
55
49
56
### Options
50
57
You need to specify a different naming pattern for different file extensions. The plugin will only check files with extensions you explicitly provided:
0 commit comments