Skip to content

Commit

Permalink
[eslint] enable no-void and disable consistent-return
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed May 19, 2019
1 parent aa0f1b6 commit c2d93ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"ignoreComments": true,
}],
"operator-linebreak": [2, "after"],
"consistent-return": 0,

"prefer-destructuring": [2, { "array": false, "object": false }, { "enforceForRenamedProperties": false }],

Expand All @@ -31,7 +32,6 @@
"no-plusplus": 1,
"no-param-reassign": 1,
"no-mixed-operators": 1,
"no-void": 1,
"no-continue": 1,
"global-require": 1,
"no-restricted-syntax": 1,
Expand Down
4 changes: 3 additions & 1 deletion lib/util/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,9 @@ function componentRule(rule, context) {
if (instruction in defaultPropsInstructions) {
defaultPropsInstructions[instruction](node);
}
return ruleInstructions[instruction] ? ruleInstructions[instruction](node) : void 0;
if (ruleInstructions[instruction]) {
return ruleInstructions[instruction](node);
}
};
});

Expand Down
5 changes: 2 additions & 3 deletions lib/util/usedPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ module.exports = function usedPropTypesInstructions(context, components, utils)
isNotInLifeCycleMethod &&
isNotInSetStateUpdater
) {
return void 0;
return;
}
if (!isDirectProp && !isDirectNextProp && !isDirectPrevProp && !isDirectSetStateProp) {
node = node.parent;
Expand All @@ -235,7 +235,7 @@ module.exports = function usedPropTypesInstructions(context, components, utils)
}
return property.name;
case 'MemberExpression':
return void 0;
return;
case 'Literal':
// Accept computed properties that are literal strings
if (typeof property.value === 'string') {
Expand All @@ -249,7 +249,6 @@ module.exports = function usedPropTypesInstructions(context, components, utils)
break;
}
}
return void 0;
}

/**
Expand Down

0 comments on commit c2d93ac

Please sign in to comment.