Skip to content

Commit

Permalink
Fix the first test
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Feb 13, 2019
1 parent ac70501 commit 4d45e7e
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -215,14 +215,26 @@ eslintTester.run('react-hooks', ReactHooksESLintRule, {
invalid: [
{
code: `
/*only*/
function MyComponent() {
const local = 42;
useEffect(() => {
console.log(local);
}, []);
}
`,
errors: [missingError('local')],
output: `
/*only*/
function MyComponent() {
const local = 42;
useEffect(() => {
console.log(local);
}, [local]);
}
`,
errors: [
'React Hook useEffect has missing [local] dependencies. Either fix or remove the dependency array.'
],
},
{
code: `
Expand Down

0 comments on commit 4d45e7e

Please sign in to comment.