Skip to content

Commit 8cc1aa8

Browse files
brettdhljharb
authored andcommitted
Fix array-to-string coercion bug
1 parent 0f480f6 commit 8cc1aa8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/rules/no-typos.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,14 @@ module.exports = {
5858
}
5959

6060
function isPropTypesPackage(node) {
61-
// Note: we really do want == with the package names here,
62-
// since we need value equality, not identity - and
63-
// these values are always string or null.
64-
/* eslint-disable eqeqeq */
6561
return (
6662
node.type === 'Identifier' &&
67-
node.name == propTypesPackageName
63+
node.name === propTypesPackageName
6864
) || (
6965
node.type === 'MemberExpression' &&
7066
node.property.name === 'PropTypes' &&
71-
node.object.name == reactPackageName
67+
node.object.name === reactPackageName
7268
);
73-
/* eslint-enable eqeqeq */
7469
}
7570

7671
/* eslint-disable no-use-before-define */
@@ -158,7 +153,7 @@ module.exports = {
158153
node.specifiers
159154
.filter(specifier => specifier.imported && specifier.imported.name === 'PropTypes')
160155
.map(specifier => specifier.local.name)
161-
) : null;
156+
)[0] : null;
162157
}
163158
},
164159

0 commit comments

Comments
 (0)