Skip to content

Commit ba56d17

Browse files
snewcomerljharb
andauthored
Update src/rules/no-duplicates.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
1 parent b00eb91 commit ba56d17

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rules/no-duplicates.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,19 @@ function getInlineTypeFix(nodes, sourceCode) {
109109
const nodeClosingBrace = nodeTokens.find(token => isPunctuator(token, '}'));
110110
// const preferInline = context.options[0] && context.options[0]['prefer-inline'];
111111
if (nodeClosingBrace) {
112-
for (const node of rest) {
112+
rest.forEach((node) => {
113113
// these will be all Type imports, no Value specifiers
114114
// then add inline type specifiers to importKind === 'type' import
115-
for (const specifier of node.specifiers) {
115+
node.specifiers.forEach((specifier) => {
116116
if (specifier.importKind === 'type') {
117117
fixes.push(fixer.insertTextBefore(nodeClosingBrace, `, type ${specifier.local.name}`));
118118
} else {
119119
fixes.push(fixer.insertTextBefore(nodeClosingBrace, `, ${specifier.local.name}`));
120120
}
121-
}
121+
});
122122

123123
fixes.push(fixer.remove(node));
124-
}
124+
});
125125
} else {
126126
// we have a default import only
127127
const defaultSpecifier = firstImport.specifiers.find((spec) => spec.type === 'ImportDefaultSpecifier');

0 commit comments

Comments
 (0)