TanStack / query

πŸ€– Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
https://tanstack.com/query
MIT License
42.72k stars 2.93k forks source link

fix(eslint-plugin-query): update deprecated `getSourceCode()` method #8117

Closed saul-atomrigs closed 1 month ago

saul-atomrigs commented 1 month ago

Captura de pantalla 2024-10-02 a las 12 03 04 a β€―m https://eslint.org/docs/latest/extend/custom-rules#accessing-the-source-code

getSourceCode() has been deprecated in favor of sourceCode. This PR introduces the latter, while also keeping the deprecated one as fallback.

nx-cloud[bot] commented 1 month ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit a22eff687a64df53a7a5f5530705d2e6d22266ca. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

πŸ“‚ See all runs for this CI Pipeline Execution


βœ… Successfully ran 2 targets - [`nx affected --targets=test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build --parallel=3`](https://cloud.nx.app/runs/or4u84nzGw?utm_source=pull-request&utm_medium=comment) - [`nx run-many --target=build --exclude=examples/** --exclude=integrations/**`](https://cloud.nx.app/runs/Fs1N3B36je?utm_source=pull-request&utm_medium=comment)

Sent with πŸ’Œ from NxCloud.

pkg-pr-new[bot] commented 1 month ago

Open in Stackblitz

More templates

- [@tanstack/query-example-angular-basic](https://pkg.pr.new/template/649e089f-d056-40ca-b757-9c8f7b5453f8) - [@tanstack/query-example-angular-infinite-query-with-max-pages](https://pkg.pr.new/template/983ebdd6-9ac6-474c-b060-92620012d74f) - [@tanstack/query-example-angular-pagination](https://pkg.pr.new/template/3d646be5-8caf-4806-9405-bcb6a88835a0) - [@tanstack/query-example-angular-router](https://pkg.pr.new/template/2e89ef99-4d6c-465f-882d-71b39a228edf) - [@tanstack/query-example-angular-rxjs](https://pkg.pr.new/template/c4043bd5-9ca0-4d79-9d1a-dbf5457c91f9) - [@tanstack/query-example-angular-simple](https://pkg.pr.new/template/1217b8b3-43f1-4770-9215-367c4f4b0575) - [@tanstack/query-example-solid-astro](https://pkg.pr.new/template/45af6b8b-277c-4b08-ace2-e16f026a931d) - [@tanstack/query-example-solid-basic](https://pkg.pr.new/template/7c265000-717b-4e0e-be60-dbcb7ec7c135) - [@tanstack/query-example-solid-basic-graphql-request](https://pkg.pr.new/template/323a3179-51e5-46ce-80b5-a020f9322a97) - [@tanstack/query-example-solid-default-query-function](https://pkg.pr.new/template/6889923e-f67f-4eca-b529-ed598d11bda6) - [@tanstack/query-example-solid-simple](https://pkg.pr.new/template/36479271-d2a2-4e37-a844-8c9667714ed3) - [@tanstack/query-example-solid-start-streaming](https://pkg.pr.new/template/c8af61f8-c6b8-4e02-98c3-40ec24cb35a8) - [@tanstack/query-example-react-algolia](https://pkg.pr.new/template/12868caa-d54e-415a-984a-a6dcca70c641) - [@tanstack/query-example-react-auto-refetching](https://pkg.pr.new/template/d999e0bf-3015-4a41-9fa9-fdb1b20a5624) - [@tanstack/query-example-react-basic](https://pkg.pr.new/template/b1a8c167-0a36-40af-b75e-0877ba217f40) - [@tanstack/query-example-react-default-query-function](https://pkg.pr.new/template/373a35b7-d8df-4b00-9144-c72dcf1f8b5d) - [@tanstack/query-example-react-basic-graphql-request](https://pkg.pr.new/template/9c768aa8-7a5d-4c5c-bef6-79490b2cab7e) - [@tanstack/query-example-react-devtools-panel](https://pkg.pr.new/template/62bc6998-9f48-4fc0-be77-72db2d9fe5be) - [@tanstack/query-example-react-infinite-query-with-max-pages](https://pkg.pr.new/template/2017ca81-7846-4889-85e8-af2addfd627e) - [@tanstack/query-example-react-load-more-infinite-scroll](https://pkg.pr.new/template/1e357e93-94ca-4d1f-b204-3d3ef2f98ead) - [@tanstack/query-example-react-nextjs-app-prefetching](https://pkg.pr.new/template/641f1684-dfb1-4c88-9499-ef4ec27604d9) - [@tanstack/query-example-react-nextjs](https://pkg.pr.new/template/2264304a-7b5c-466c-96bc-5c7d4268ed9b) - [@tanstack/query-example-nextjs-suspense-streaming](https://pkg.pr.new/template/e8853366-422d-47b6-a82c-e4e943ae4be0) - [@tanstack/query-example-react-offline](https://pkg.pr.new/template/b4a239ff-0729-4e0c-bb80-51083fec6d10) - [@tanstack/query-example-react-optimistic-updates-cache](https://pkg.pr.new/template/710e522b-0db0-4c1e-80ad-fe863ee5ad8e) - [@tanstack/query-example-react-pagination](https://pkg.pr.new/template/6f6a9db4-b837-490b-86c9-cbd013e9afb7) - [@tanstack/query-example-react-optimistic-updates-ui](https://pkg.pr.new/template/ebdd15c6-8149-48a9-9adc-fae4267b5219) - [@tanstack/query-example-react-prefetching](https://pkg.pr.new/template/3fe331c0-8812-4615-85ef-198b6cb32a1f) - [@tanstack/query-example-react-playground](https://pkg.pr.new/template/f0fe0e60-0ae1-41d4-a884-c21629f3e1b3) - [@tanstack/query-example-react-router](https://pkg.pr.new/template/f33d94ab-404b-4979-9437-2eef3727cdc3) - [@tanstack/query-example-react-react-native](https://pkg.pr.new/template/9d5394c1-b428-47fe-8393-2a0a872dabcf) - [@tanstack/query-example-react-rick-morty](https://pkg.pr.new/template/c300199a-ffde-4f74-87d4-ea61d09330f1) - [@tanstack/query-example-react-simple](https://pkg.pr.new/template/fb61e240-533b-4ce1-ae1b-2d70ef13a05e) - [@tanstack/query-example-react-shadow-dom](https://pkg.pr.new/template/5f221cb7-0eb0-45fa-b6bb-8a3c1c4ab687) - [@tanstack/query-example-react-star-wars](https://pkg.pr.new/template/de7bab1b-61bb-4862-aaed-d9fa684ac5c2) - [@tanstack/query-example-react-suspense](https://pkg.pr.new/template/1a9968d2-59a7-496c-947a-c4953666d512) - [@tanstack/query-example-svelte-auto-refetching](https://pkg.pr.new/template/45234ce8-6adf-44b2-b8f3-66400870a900) - [@tanstack/query-example-svelte-basic](https://pkg.pr.new/template/e77834a6-020d-41e2-b9e3-46ffd420fd4c) - [@tanstack/query-example-svelte-optimistic-updates](https://pkg.pr.new/template/5bde6e9b-aa57-4e30-b0fc-6278680cb6e5) - [@tanstack/query-example-svelte-load-more-infinite-scroll](https://pkg.pr.new/template/7704d271-051e-4d55-a8f3-b3b396ba8679) - [@tanstack/query-example-svelte-playground](https://pkg.pr.new/template/2da514ed-e4b0-4ea2-b652-941ebe1e15e0) - [@tanstack/query-example-svelte-simple](https://pkg.pr.new/template/3e6cb63e-c8b9-4b9f-bd84-9cc414da484c) - [@tanstack/query-example-svelte-ssr](https://pkg.pr.new/template/560b0afc-dad8-44ea-b758-bbae782cc51a) - [@tanstack/query-example-svelte-star-wars](https://pkg.pr.new/template/6a263bb1-241e-4ff6-acfe-01cf3dc093ed) - [@tanstack/query-example-vue-2.7-basic](https://pkg.pr.new/template/3b3d3c06-3c69-47dc-a19d-49b799b1c7e2) - [@tanstack/query-example-vue-2.6-basic](https://pkg.pr.new/template/083eee1e-5415-473f-a7d5-11e40de8622b) - [@tanstack/query-example-vue-basic](https://pkg.pr.new/template/31982d06-ec03-4b33-bf3d-9ecb5716a6e2) - [@tanstack/query-example-vue-nuxt3](https://pkg.pr.new/template/d69822ae-2bbe-4def-8118-d38176d45841) - [@tanstack/query-example-vue-dependent-queries](https://pkg.pr.new/template/1b127e0c-148e-4a5d-9c24-88f44a905497) - [@tanstack/query-example-vue-persister](https://pkg.pr.new/template/e602ec2b-3345-4eea-8ef7-538adca290ec) - [@tanstack/query-example-vue-simple](https://pkg.pr.new/template/d61291fd-2cbc-416e-aa19-35f280819ab3)

@tanstack/angular-query-devtools-experimental

``` pnpm add https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@8117 ```

@tanstack/angular-query-experimental

``` pnpm add https://pkg.pr.new/@tanstack/angular-query-experimental@8117 ```

@tanstack/eslint-plugin-query

``` pnpm add https://pkg.pr.new/@tanstack/eslint-plugin-query@8117 ```

@tanstack/query-async-storage-persister

``` pnpm add https://pkg.pr.new/@tanstack/query-async-storage-persister@8117 ```

@tanstack/query-broadcast-client-experimental

``` pnpm add https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@8117 ```

@tanstack/query-core

``` pnpm add https://pkg.pr.new/@tanstack/query-core@8117 ```

@tanstack/query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/query-devtools@8117 ```

@tanstack/query-persist-client-core

``` pnpm add https://pkg.pr.new/@tanstack/query-persist-client-core@8117 ```

@tanstack/query-sync-storage-persister

``` pnpm add https://pkg.pr.new/@tanstack/query-sync-storage-persister@8117 ```

@tanstack/react-query

``` pnpm add https://pkg.pr.new/@tanstack/react-query@8117 ```

@tanstack/react-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/react-query-devtools@8117 ```

@tanstack/react-query-next-experimental

``` pnpm add https://pkg.pr.new/@tanstack/react-query-next-experimental@8117 ```

@tanstack/react-query-persist-client

``` pnpm add https://pkg.pr.new/@tanstack/react-query-persist-client@8117 ```

@tanstack/solid-query

``` pnpm add https://pkg.pr.new/@tanstack/solid-query@8117 ```

@tanstack/solid-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/solid-query-devtools@8117 ```

@tanstack/solid-query-persist-client

``` pnpm add https://pkg.pr.new/@tanstack/solid-query-persist-client@8117 ```

@tanstack/svelte-query

``` pnpm add https://pkg.pr.new/@tanstack/svelte-query@8117 ```

@tanstack/svelte-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/svelte-query-devtools@8117 ```

@tanstack/svelte-query-persist-client

``` pnpm add https://pkg.pr.new/@tanstack/svelte-query-persist-client@8117 ```

@tanstack/vue-query

``` pnpm add https://pkg.pr.new/@tanstack/vue-query@8117 ```

@tanstack/vue-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/vue-query-devtools@8117 ```

commit: a22eff6

TkDodo commented 1 month ago

you need to disable the linter for that fallback:

/home/workflows/workspace/packages/eslint-plugin-query/src/rules/stable-query-client/stable-query-client.rule.ts
  72:32  error  Unnecessary conditional, expected left-hand side of `??` operator to be possibly null or undefined  @typescript-eslint/no-unnecessary-condition
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.82%. Comparing base (05924f4) to head (a22eff6). Report is 1 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/TanStack/query/pull/8117/graphs/tree.svg?width=650&height=150&src=pr&token=jqEbswkEDQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack)](https://app.codecov.io/gh/TanStack/query/pull/8117?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) ```diff @@ Coverage Diff @@ ## main #8117 +/- ## ========================================= + Coverage 0 87.82% +87.82% ========================================= Files 0 15 +15 Lines 0 493 +493 Branches 0 183 +183 ========================================= + Hits 0 433 +433 - Misses 0 46 +46 - Partials 0 14 +14 ``` | [Components](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | Coverage Ξ” | | |---|---|---| | [@tanstack/angular-query-devtools-experimental](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/angular-query-experimental](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/eslint-plugin-query](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `87.82% <100.00%> (βˆ…)` | | | [@tanstack/query-async-storage-persister](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/query-broadcast-client-experimental](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/query-codemods](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/query-core](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/query-persist-client-core](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/query-sync-storage-persister](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/react-query](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/react-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/react-query-next-experimental](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/react-query-persist-client](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/solid-query](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/solid-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/solid-query-persist-client](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/svelte-query](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/svelte-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/svelte-query-persist-client](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/vue-query](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | | | [@tanstack/vue-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8117/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `βˆ… <ΓΈ> (βˆ…)` | |
saul-atomrigs commented 1 month ago

Thanks for the reminder, I've just added the eslint-disable