Skip to content

Commit b638e41

Browse files
Fix cases of @typescript-eslint/no-for-in-array
1 parent 4bd054d commit b638e41

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

extensions/ql-vscode/gulpfile.ts/textmate.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ function getNodeMatchText(rule: Pattern): string {
6666
} else if (rule.patterns !== undefined) {
6767
const patterns: string[] = [];
6868
// For a list of patterns, use the disjunction of those patterns.
69-
for (const patternIndex in rule.patterns) {
70-
const pattern = rule.patterns[patternIndex];
69+
for (const pattern of rule.patterns) {
7170
if (pattern.include !== null) {
7271
patterns.push(`(?${pattern.include})`);
7372
}
@@ -180,11 +179,11 @@ function expandPatternMatchProperties<T>(
180179
const patterns: string[] = Array.isArray(pattern) ? pattern : [pattern];
181180
rule[key] = patterns.map((p) => `((?${p}))`).join("|") as T;
182181
const captures: Pattern["captures"] = {};
183-
for (const patternIndex in patterns) {
184-
captures[(Number(patternIndex) + 1).toString()] = {
182+
for (const [captureIndex, capture] of patterns.entries()) {
183+
captures[(Number(captureIndex) + 1).toString()] = {
185184
patterns: [
186185
{
187-
include: patterns[patternIndex],
186+
include: capture,
188187
},
189188
],
190189
};

0 commit comments

Comments
 (0)