Skip to content

Commit a987e22

Browse files
committed
moar feedback
1 parent 9abf816 commit a987e22

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/rules/no-duplicates.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ function checkImports(imported, context) {
3333
}
3434

3535
function checkTypeImports(imported, context) {
36-
for (const [module, nodes] of imported.entries()) {
36+
Array.from(imported).forEach(([module, nodes]) => {
3737
const typeImports = nodes.filter((node) => node.importKind === 'type');
3838
if (nodes.length > 1) {
39-
const someInlineTypeImports = nodes.filter((node) => node.specifiers.some((spec) => spec.importKind === 'type'));
40-
if (typeImports.length > 0 && someInlineTypeImports.length > 0) {
39+
const someInlineTypeImports = nodes.some((node) => node.specifiers.some((spec) => spec.importKind === 'type'));
40+
if (typeImports.length > 0 && someInlineTypeImports) {
4141
const message = `'${module}' imported multiple times.`;
4242
const sourceCode = context.getSourceCode();
4343
const fix = getTypeFix(nodes, sourceCode, context);
@@ -57,11 +57,11 @@ function checkTypeImports(imported, context) {
5757
});
5858
}
5959
}
60-
}
60+
});
6161
}
6262

6363
function checkInlineTypeImports(imported, context) {
64-
for (const [module, nodes] of imported.entries()) {
64+
Array.from(imported).forEach(([module, nodes]) => {
6565
if (nodes.length > 1) {
6666
const message = `'${module}' imported multiple times.`;
6767
const sourceCode = context.getSourceCode();
@@ -81,7 +81,7 @@ function checkInlineTypeImports(imported, context) {
8181
});
8282
});
8383
}
84-
}
84+
});
8585
}
8686

8787
function isComma(token) {

0 commit comments

Comments
 (0)