We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c03d56 commit 34d2e33Copy full SHA for 34d2e33
lib/rules/no-multi-comp.js
@@ -65,9 +65,9 @@ module.exports = {
65
if (node.declaration.type === 'ClassDeclaration') {
66
return node.declaration.id.name;
67
}
68
- for (const declarator of node.declaration.declarations || []) {
69
- const type = declarator.init.type;
70
- if (validIdentifiers.has(type)) {
+ if (node.declaration.declarations) {
+ const declarator = node.declaration.declarations.find((declarator) => validIdentifiers.has(declarator.init.type));
+ if (declarator) {
71
return declarator.id.name;
72
73
0 commit comments