Skip to content

Conversation

@Newbie012
Copy link
Collaborator

fixes #4476

Honestly, I'm unsure how I feel about this fix. Since we need to support @babel/eslint-parser, we need to find a different way to get a function's "return type".

I'm not sure how I feel about my approach - The linter will check all possible return nodes, and if at least one node is not an ObjectExpression, the linter will report that node.

I'm open to suggestions.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 11, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 588b6a6:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-vue-basic Configuration

@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2022

Codecov Report

Base: 96.36% // Head: 92.42% // Decreases project coverage by -3.93% ⚠️

Coverage data is based on head (588b6a6) compared to base (eab6e2c).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4497      +/-   ##
==========================================
- Coverage   96.36%   92.42%   -3.94%     
==========================================
  Files          45       88      +43     
  Lines        2281     3642    +1361     
  Branches      640      954     +314     
==========================================
+ Hits         2198     3366    +1168     
- Misses         80      260     +180     
- Partials        3       16      +13     
Impacted Files Coverage Δ
src/core/queryCache.ts
src/react/tests/utils.tsx
src/react/useInfiniteQuery.ts
src/core/retryer.ts
src/react/reactBatchedUpdates.ts
src/devtools/Logo.tsx
src/react/Hydrate.tsx
src/react/useMutation.ts
src/devtools/tests/utils.tsx
src/devtools/theme.tsx
... and 123 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Newbie012 Newbie012 marked this pull request as ready for review November 11, 2022 01:34
@TkDodo
Copy link
Collaborator

TkDodo commented Nov 11, 2022

I think it's good 👍 . The only other thing would be to depend on typescript types, not sure if you think this would be generally better. But if, we'll do this for v5 only I guess...

@TkDodo TkDodo merged commit 933cd41 into TanStack:main Nov 11, 2022
@Newbie012
Copy link
Collaborator Author

It would require much less code and probably a more precise check, but it will hurt the plugin's adoption, so I guess we'll stick with the current implementation for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eslint-plugin-query: false positive for factory functions that return an object

3 participants