Skip to content

Commit 6ba726d

Browse files
snewcomerljharb
andcommitted
Update src/rules/no-duplicates.js
Co-authored-by: Jordan Harband <[email protected]>
1 parent ce537c0 commit 6ba726d

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
@@ -111,19 +111,19 @@ function getInlineTypeFix(nodes, sourceCode) {
111111
const nodeClosingBrace = nodeTokens.find(token => isPunctuator(token, '}'));
112112
// const preferInline = context.options[0] && context.options[0]['prefer-inline'];
113113
if (nodeClosingBrace) {
114-
for (const node of rest) {
114+
rest.forEach((node) => {
115115
// these will be all Type imports, no Value specifiers
116116
// then add inline type specifiers to importKind === 'type' import
117-
for (const specifier of node.specifiers) {
117+
node.specifiers.forEach((specifier) => {
118118
if (specifier.importKind === 'type') {
119119
fixes.push(fixer.insertTextBefore(nodeClosingBrace, `, type ${specifier.local.name}`));
120120
} else {
121121
fixes.push(fixer.insertTextBefore(nodeClosingBrace, `, ${specifier.local.name}`));
122122
}
123-
}
123+
});
124124

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

0 commit comments

Comments
 (0)