Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Revert "Fix hook strict return on undefined retuns (#251)"
Browse files Browse the repository at this point in the history
This reverts commit a94bed7.
  • Loading branch information
Matt Seccafien authored Apr 27, 2019
1 parent a94bed7 commit 3f5bdb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
10 changes: 3 additions & 7 deletions lib/rules/react-hooks-strict-return.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,9 @@ module.exports = {
};

function exceedsMaxReturnProperties(node, scope, max) {
const {argument} = node;

if (argument === null) {
return false;
}

const {type, elements} = argument;
const {
argument: {type, elements},
} = node;

if (type !== 'ArrayExpression') {
return getProps(node, scope).length > max;
Expand Down
10 changes: 0 additions & 10 deletions tests/lib/rules/react-hooks-strict-return.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,6 @@ ruleTester.run('react-hooks-strict-return', rule, {
}`,
parser,
},
{
code: `function useHookWithNoReturn() {}`,
parser,
},
{
code: `function useHookUndefinedReturn() {
return;
}`,
parser,
},
],
invalid: [
{
Expand Down

0 comments on commit 3f5bdb0

Please sign in to comment.