Skip to content

Commit

Permalink
moar feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer committed Aug 6, 2023
1 parent 59e4332 commit 0d2b737
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/rules/no-duplicates.js
Expand Up @@ -35,11 +35,11 @@ function checkImports(imported, context) {
}

function checkTypeImports(imported, context) {
for (const [module, nodes] of imported.entries()) {
Array.from(imported).forEach(([module, nodes]) => {
const typeImports = nodes.filter((node) => node.importKind === 'type');
if (nodes.length > 1) {
const someInlineTypeImports = nodes.filter((node) => node.specifiers.some((spec) => spec.importKind === 'type'));
if (typeImports.length > 0 && someInlineTypeImports.length > 0) {
const someInlineTypeImports = nodes.some((node) => node.specifiers.some((spec) => spec.importKind === 'type'));
if (typeImports.length > 0 && someInlineTypeImports) {
const message = `'${module}' imported multiple times.`;
const sourceCode = context.getSourceCode();
const fix = getTypeFix(nodes, sourceCode, context);
Expand All @@ -59,11 +59,11 @@ function checkTypeImports(imported, context) {
});
}
}
}
});
}

function checkInlineTypeImports(imported, context) {
for (const [module, nodes] of imported.entries()) {
Array.from(imported).forEach(([module, nodes]) => {
if (nodes.length > 1) {
const message = `'${module}' imported multiple times.`;
const sourceCode = context.getSourceCode();
Expand All @@ -83,7 +83,7 @@ function checkInlineTypeImports(imported, context) {
});
});
}
}
});
}

function isComma(token) {
Expand Down

0 comments on commit 0d2b737

Please sign in to comment.