Skip to content

Commit

Permalink
moar feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer committed Feb 20, 2023
1 parent 9abf816 commit a987e22
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/rules/no-duplicates.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,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 @@ -57,11 +57,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 @@ -81,7 +81,7 @@ function checkInlineTypeImports(imported, context) {
});
});
}
}
});
}

function isComma(token) {
Expand Down

0 comments on commit a987e22

Please sign in to comment.