Skip to content

Commit da04e17

Browse files
committed
logic fixes
1 parent a4fb0a4 commit da04e17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/rules/no-multi-comp.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = {
5454
const exportOnly = configuration.exportOnly || false;
5555

5656
const exportedComponents = new Set(); // Track exported components
57-
const validIdentifiers = ['ArrowFunctionExpression', 'Identifier', 'FunctionExpression'];
57+
const validIdentifiers = new Set(['ArrowFunctionExpression', 'Identifier', 'FunctionExpression']);
5858

5959
/**
6060
* Given an export declaration, find the export name.
@@ -67,7 +67,7 @@ module.exports = {
6767
}
6868
for (const declarator of node.declaration.declarations || []) {
6969
const type = declarator.init.type;
70-
if (validIdentifiers.find(type)) {
70+
if (validIdentifiers.has(type)) {
7171
return declarator.id.name;
7272
}
7373
}
@@ -80,7 +80,7 @@ module.exports = {
8080
*/
8181
function findComponentIdentifierFromComponent(component) {
8282
let name;
83-
if (component.node.parent) {
83+
if (component.node.parent.id) {
8484
name = component.node.parent.id.name;
8585
}
8686
if (!name) {

0 commit comments

Comments
 (0)