Skip to content

Commit 24daeff

Browse files
committed
refactor: fix tests 6
1 parent 36346d5 commit 24daeff

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

nx.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@
172172
"options": {
173173
"targetName": "lint-multi",
174174
"maxWarnings": 0,
175-
"cache": true
175+
"cache": true,
176+
"include": "**/project.json"
176177
}
177178
}
178179
],

tools/src/eslint-concurrency-target/eslint-concurrency-target.plugin.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,29 @@ import { existsSync } from 'node:fs';
22
import { dirname, relative } from 'node:path';
33

44
function matchesIncludePattern(filePath, includePattern) {
5-
// Simple pattern matching for {packages,e2e,testing,examples}/*/project.json
65
const normalizedPath = filePath.replace(/\\/g, '/');
7-
const pattern = includePattern
8-
.replace(/\{([^}]+)\}/, '($1)')
9-
.replace(/,/g, '|')
10-
.replace(/\*/g, '[^/]+');
6+
7+
// Handle special case for **/project.json (match all)
8+
if (includePattern === '**/project.json') {
9+
return (
10+
normalizedPath.endsWith('/project.json') ||
11+
normalizedPath === 'project.json'
12+
);
13+
}
14+
15+
// Handle {packages,e2e,testing,examples}/*/project.json pattern
16+
if (includePattern.includes('{') && includePattern.includes('}')) {
17+
const pattern = includePattern
18+
.replace(/\{([^}]+)\}/, '($1)')
19+
.replace(/,/g, '|')
20+
.replace(/\*\*/g, '.*')
21+
.replace(/\*/g, '[^/]+');
22+
const regex = new RegExp(`^${pattern}$`);
23+
return regex.test(normalizedPath);
24+
}
25+
26+
// Simple glob-like matching
27+
const pattern = includePattern.replace(/\*\*/g, '.*').replace(/\*/g, '[^/]+');
1128
const regex = new RegExp(`^${pattern}$`);
1229
return regex.test(normalizedPath);
1330
}

0 commit comments

Comments
 (0)