Skip to content

Commit

Permalink
[jsx-max-depth]: Add test case for recursion error, jsx-eslint#2880
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Mar 27, 2021
1 parent c2a790a commit c10a2ac
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/lib/rules/jsx-max-depth.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,23 @@ ruleTester.run('jsx-max-depth', rule, {
' return <div>{A}</div>;',
'}'
].join('\n')
}, {
code: `
let ref2 = "";
class MyClassComponent extends React.Component {
updateRef(valueForRef) {
ref2 = valueForRef;
}
render() {
// This part is required for the crash even though reassigned value is not used
const valueForRef = ref2;
return <div ref={ref2} />;
}
}
`
}],

invalid: [{
Expand Down

0 comments on commit c10a2ac

Please sign in to comment.