Skip to content

Commit 4e77593

Browse files
committed
moar feedback
1 parent de7c535 commit 4e77593

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
@@ -35,11 +35,11 @@ function checkImports(imported, context) {
3535
}
3636

3737
function checkTypeImports(imported, context) {
38-
for (const [module, nodes] of imported.entries()) {
38+
Array.from(imported).forEach(([module, nodes]) => {
3939
const typeImports = nodes.filter((node) => node.importKind === 'type');
4040
if (nodes.length > 1) {
41-
const someInlineTypeImports = nodes.filter((node) => node.specifiers.some((spec) => spec.importKind === 'type'));
42-
if (typeImports.length > 0 && someInlineTypeImports.length > 0) {
41+
const someInlineTypeImports = nodes.some((node) => node.specifiers.some((spec) => spec.importKind === 'type'));
42+
if (typeImports.length > 0 && someInlineTypeImports) {
4343
const message = `'${module}' imported multiple times.`;
4444
const sourceCode = context.getSourceCode();
4545
const fix = getTypeFix(nodes, sourceCode, context);
@@ -59,11 +59,11 @@ function checkTypeImports(imported, context) {
5959
});
6060
}
6161
}
62-
}
62+
});
6363
}
6464

6565
function checkInlineTypeImports(imported, context) {
66-
for (const [module, nodes] of imported.entries()) {
66+
Array.from(imported).forEach(([module, nodes]) => {
6767
if (nodes.length > 1) {
6868
const message = `'${module}' imported multiple times.`;
6969
const sourceCode = context.getSourceCode();
@@ -83,7 +83,7 @@ function checkInlineTypeImports(imported, context) {
8383
});
8484
});
8585
}
86-
}
86+
});
8787
}
8888

8989
function isComma(token) {

0 commit comments

Comments
 (0)