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-4Lines changed: 27 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -45,16 +45,15 @@ In addition to the built-in naming conventions, you can also set custom naming p
45
45
...
46
46
```
47
47
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`.
48
+
**Tip:** To selecte all your `js` files, your can use the glob expression `**/*.js`.
51
49
52
50
:warning::warning::warning:
53
51
**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
52
55
53
56
54
### Options
57
-
You need to specify a different naming pattern for different file extensions. The plugin will only check files with extensions you explicitly provided:
55
+
#### naming pattern object
56
+
You need to specify a different naming pattern for different file. The plugin will only check files you explicitly selected:
58
57
59
58
```js
60
59
module.exports= {
@@ -70,6 +69,30 @@ module.exports = {
70
69
};
71
70
```
72
71
72
+
#### rule configuration object
73
+
##### `ignoreMiddleExtensions`
74
+
If `true`, the rule will ignore the middle extensions of the filename.
75
+
76
+
In some cases, you may want to ignore the middle extensions of the filename. For example, you want to lint the base name of the config and test/spec files—e.g., `babel.config.js` and `date.test.js`, you can do so by setting the `ignoreMiddleExtensions` option to `true`, and the rule will only validate its base name, in this case the base name will be `babel` and `date`.
0 commit comments