Skip to content

Commit

Permalink
forEach -> for...of
Browse files Browse the repository at this point in the history
  • Loading branch information
pboos committed Oct 28, 2024
1 parent 7e7ef72 commit 6ede57d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/core/src/rules/oas3/component-name-unique.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const ComponentNameUnique: Oas3Rule | Oas2Rule = (options) => {
const component = getComponentFromKey(key);
const optionComponentName = getOptionComponentNameForTypeName(component.typeName);
const componentSeverity = optionComponentName ? options[optionComponentName] : null;
value.locations.forEach((location) => {
for (const location of value.locations) {
const definitions = Array.from(value.absolutePointers)
.filter((v) => v !== location.absolutePointer.toString())
.map((v) => `- ${v}`)
Expand All @@ -73,8 +73,7 @@ export const ComponentNameUnique: Oas3Rule | Oas2Rule = (options) => {
problem.forceSeverity = componentSeverity;
}
ctx.report(problem);
});

}
}
});
},
Expand Down

0 comments on commit 6ede57d

Please sign in to comment.