Skip to content

Commit 7d05324

Browse files
committed
Fix lint errors
1 parent 082dabb commit 7d05324

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/rules/no-typos.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ 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 */
6165
return (
6266
node.type === 'Identifier' &&
6367
node.name == propTypesPackageName
@@ -66,8 +70,11 @@ module.exports = {
6670
node.property.name === 'PropTypes' &&
6771
node.object.name == reactPackageName
6872
);
73+
/* eslint-enable eqeqeq */
6974
}
7075

76+
/* eslint-disable no-use-before-define */
77+
7178
function checkValidCallExpression(node) {
7279
const callee = node.callee;
7380
if (callee.type === 'MemberExpression' && callee.property.name === 'shape') {
@@ -80,7 +87,6 @@ module.exports = {
8087
}
8188
}
8289

83-
/* eslint-disable no-use-before-define */
8490
function checkValidProp(node) {
8591
if ((!propTypesPackageName && !reactPackageName) || !node) {
8692
return;
@@ -107,6 +113,8 @@ module.exports = {
107113
}
108114
}
109115

116+
/* eslint-enable no-use-before-define */
117+
110118
function checkValidPropObject (node) {
111119
if (node && node.type === 'ObjectExpression') {
112120
node.properties.forEach(prop => checkValidProp(prop.value));

0 commit comments

Comments
 (0)