Skip to content

Commit

Permalink
Merge pull request #43 from salute-developers/fix_for-no-redundant-co…
Browse files Browse the repository at this point in the history
…mmit

fix(eslint-config): fixed no-redundant-commit
  • Loading branch information
SeanSilke authored Aug 5, 2024
2 parents e2eb67a + 35bb67e commit b6346ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/eslint-config/rules/no-redundant-commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module.exports = {

const variableNodes = node.parent.id.elements;
const setterVariable = variableNodes[1];
currentComponentStateSettersNames.push(setterVariable.name);
setterVariable && currentComponentStateSettersNames.push(setterVariable.name);
}

if (
Expand Down
9 changes: 9 additions & 0 deletions packages/eslint-config/rules/no-redundant-commit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ const tests = {
}
return <Loader />;
}
`,
},
{
code: `
function MyComponent() {
const [constant] = useState(false);
return <Component />;
}
`,
},
{
Expand Down

0 comments on commit b6346ed

Please sign in to comment.