Skip to content

Commit 84d25c4

Browse files
3.10.11
1 parent 8276d3f commit 84d25c4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/rules/independentModules/helpers/getDirnamePath.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ describe("getDirnamePath", () => {
77
pattern: "{dirname}/*.ts",
88
expected: "C:/Users/user/Desktop/repo",
99
},
10+
{
11+
filename: "C:/Users/user/Desktop/(components)/src/",
12+
pattern: "{dirname}/*.ts",
13+
expected: "C:/Users/user/Desktop/\\(components\\)",
14+
},
1015
{
1116
filename: "C:/Users/user/Desktop/repo/src/",
1217
pattern: "{dirname_1}/*.ts",

src/rules/independentModules/helpers/getDirnamePath.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ export const getDirnamePath = (fileName: string, pattern: string): string => {
1111
dirnamePath = path.dirname(dirnamePath);
1212
}
1313

14-
return dirnamePath;
14+
return dirnamePath.replace(/[()]/g, (match) => `\\${match}`);
1515
};

0 commit comments

Comments
 (0)