Skip to content

Commit

Permalink
test(eslint-plugin): add test (#5218)
Browse files Browse the repository at this point in the history
Co-authored-by: Dominik Dorfmeister <[email protected]>
  • Loading branch information
Newbie012 and TkDodo authored Apr 2, 2023
1 parent 5c3943e commit 88f144c
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ ruleTester.run('exhaustive-deps', rule, {
name: 'should not pass api.entity.get',
code: 'useQuery({ queryKey: ["entity", id], queryFn: () => api.entity.get(id) });',
},
{
name: 'should not pass api when is being used for calling a function',
code: `
import useApi from './useApi'
const useFoo = () => {
const api = useApi();
return useQuery({
queryKey: ['foo'],
queryFn: () => api.fetchFoo(),
})
}
`,
},
{
name: 'should pass props.src',
code: `
Expand Down

0 comments on commit 88f144c

Please sign in to comment.