Skip to content

Commit 21a1c3e

Browse files
committed
feat: remove legacy support for selecting target files based on their extensions
1 parent 906e373 commit 21a1c3e

File tree

4 files changed

+318
-385
lines changed

4 files changed

+318
-385
lines changed

docs/rules/filename-naming-convention.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ In addition to the built-in naming conventions, you can also set custom naming p
4949

5050
:warning: :warning: :warning:
5151

52-
**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.**
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.**
5353

5454

5555
### Options

lib/rules/filename-naming-convention.js

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,12 @@ module.exports = {
7070
const filename = getFilename(filenameWithPath);
7171

7272
for (const [fexPattern, namingPattern] of Object.entries(rules)) {
73-
const matchResult =
74-
matchRule(
75-
filenameWithPath,
76-
fexPattern,
77-
getBasename(filename, ignoreMiddleExtensions),
78-
namingPattern
79-
) ||
80-
// legacy support for version below v1.2.0
81-
// file only can be specified by fex pattern, not by file path pattern
82-
// it's a legacy feature, will be removed in the future
83-
matchRule(
84-
filename,
85-
fexPattern,
86-
getBasename(filename, ignoreMiddleExtensions),
87-
namingPattern
88-
);
73+
const matchResult = matchRule(
74+
filenameWithPath,
75+
fexPattern,
76+
getBasename(filename, ignoreMiddleExtensions),
77+
namingPattern
78+
);
8979

9080
if (matchResult) {
9181
const { path, pattern } = matchResult;

0 commit comments

Comments
 (0)