Skip to content

Commit c2d93ac

Browse files
committed
[eslint] enable no-void and disable consistent-return
1 parent aa0f1b6 commit c2d93ac

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"ignoreComments": true,
2323
}],
2424
"operator-linebreak": [2, "after"],
25+
"consistent-return": 0,
2526

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

@@ -31,7 +32,6 @@
3132
"no-plusplus": 1,
3233
"no-param-reassign": 1,
3334
"no-mixed-operators": 1,
34-
"no-void": 1,
3535
"no-continue": 1,
3636
"global-require": 1,
3737
"no-restricted-syntax": 1,

lib/util/Components.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,9 @@ function componentRule(rule, context) {
785785
if (instruction in defaultPropsInstructions) {
786786
defaultPropsInstructions[instruction](node);
787787
}
788-
return ruleInstructions[instruction] ? ruleInstructions[instruction](node) : void 0;
788+
if (ruleInstructions[instruction]) {
789+
return ruleInstructions[instruction](node);
790+
}
789791
};
790792
});
791793

lib/util/usedPropTypes.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ module.exports = function usedPropTypesInstructions(context, components, utils)
221221
isNotInLifeCycleMethod &&
222222
isNotInSetStateUpdater
223223
) {
224-
return void 0;
224+
return;
225225
}
226226
if (!isDirectProp && !isDirectNextProp && !isDirectPrevProp && !isDirectSetStateProp) {
227227
node = node.parent;
@@ -235,7 +235,7 @@ module.exports = function usedPropTypesInstructions(context, components, utils)
235235
}
236236
return property.name;
237237
case 'MemberExpression':
238-
return void 0;
238+
return;
239239
case 'Literal':
240240
// Accept computed properties that are literal strings
241241
if (typeof property.value === 'string') {
@@ -249,7 +249,6 @@ module.exports = function usedPropTypesInstructions(context, components, utils)
249249
break;
250250
}
251251
}
252-
return void 0;
253252
}
254253

255254
/**

0 commit comments

Comments
 (0)