Skip to content

Commit cb62f4f

Browse files
authored
chore(*): adopt '@tanstack/oxlint-config' and '@tanstack/oxfmt-config', and fix the newly reported lint errors (#12555)
* chore(*): adopt '@tanstack/oxlint-config' and '@tanstack/oxfmt-config', and fix the newly reported lint errors * chore(pnpm-lock.yaml): run 'pnpm dedupe' * chore(scripts): move 'oxlint/plugin.ts' to 'oxlint-plugin.ts' to match the flat layout of 'scripts' * chore(pnpm-workspace.yaml): update '@typescript-eslint/parser' and '@typescript-eslint/rule-tester' to '^8.72.1' to match the deduped '@typescript-eslint/utils'
1 parent 0ca0523 commit cb62f4f

1,081 files changed

Lines changed: 2423 additions & 2783 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/eslint/eslint-plugin-query.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ The plugin can also be used with [Oxlint](https://oxc.rs/docs/guide/usage/linter
125125
To enable all of the recommended rules for our plugin, add the plugin to `jsPlugins` and spread the rules of the `recommended` config:
126126

127127
```ts
128-
import { defineConfig } from 'oxlint'
129128
import pluginQuery from '@tanstack/eslint-plugin-query'
129+
import { defineConfig } from 'oxlint'
130130

131131
export default defineConfig({
132132
jsPlugins: ['@tanstack/eslint-plugin-query'],

‎docs/eslint/no-unstable-deps.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Instead, destructure the return value of the query hook and pass the destructure
2121
Examples of **incorrect** code for this rule:
2222

2323
```tsx
24+
import { useMutation } from '@tanstack/react-query'
2425
/* eslint "@tanstack/query/no-unstable-deps": "warn" */
2526
import { useCallback } from 'react'
26-
import { useMutation } from '@tanstack/react-query'
2727

2828
function Component() {
2929
const mutation = useMutation({ mutationFn: (value: string) => value })
@@ -37,9 +37,9 @@ function Component() {
3737
Examples of **correct** code for this rule:
3838

3939
```tsx
40+
import { useMutation } from '@tanstack/react-query'
4041
/* eslint "@tanstack/query/no-unstable-deps": "warn" */
4142
import { useCallback } from 'react'
42-
import { useMutation } from '@tanstack/react-query'
4343

4444
function Component() {
4545
const { mutate } = useMutation({ mutationFn: (value: string) => value })

‎docs/framework/angular/devtools.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
QueryClient,
2121
provideTanStackQuery,
2222
} from '@tanstack/angular-query-experimental'
23-
2423
import { withDevtools } from '@tanstack/angular-query-experimental/devtools'
2524

2625
export const appConfig: ApplicationConfig = {
@@ -59,9 +58,9 @@ When setting the option to true, the devtools will be loaded in both development
5958
This is useful if you want to load devtools based on [Angular environment configurations](https://angular.dev/tools/cli/environments). E.g. you could set this to true when the application is running on your production build staging environment.
6059

6160
```ts
62-
import { environment } from './environments/environment'
6361
// Make sure to use the production sub-path to load devtools in production builds
6462
import { withDevtools } from '@tanstack/angular-query-experimental/devtools/production'
63+
import { environment } from './environments/environment'
6564

6665
provideTanStackQuery(
6766
new QueryClient(),
@@ -87,8 +86,8 @@ The example below always loads devtools in development mode and loads on-demand
8786

8887
```ts
8988
import { Injectable, isDevMode } from '@angular/core'
90-
import { fromEvent, map, scan } from 'rxjs'
9189
import { toSignal } from '@angular/core/rxjs-interop'
90+
import { fromEvent, map, scan } from 'rxjs'
9291

9392
@Injectable({ providedIn: 'root' })
9493
export class DevtoolsOptionsManager {

‎docs/framework/angular/overview.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ In the example below, you can see TanStack Query in its most basic and simple fo
6161
[Open in StackBlitz](https://stackblitz.com/github/TanStack/query/tree/main/examples/angular/simple)
6262

6363
```angular-ts
64-
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
6564
import { HttpClient } from '@angular/common/http'
65+
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
6666
import { injectQuery } from '@tanstack/angular-query-experimental'
6767
import { lastValueFrom } from 'rxjs'
6868

‎docs/framework/angular/quick-start.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@ export class AppModule {}
4444
### Component with query and mutation
4545

4646
```angular-ts
47-
import { Component, Injectable, inject } from '@angular/core'
4847
import { HttpClient } from '@angular/common/http'
49-
import { lastValueFrom } from 'rxjs'
50-
48+
import { Component, Injectable, inject } from '@angular/core'
5149
import {
5250
injectMutation,
5351
injectQuery,
5452
QueryClient,
5553
} from '@tanstack/angular-query-experimental'
54+
import { lastValueFrom } from 'rxjs'
5655
5756
@Component({
5857
template: `

‎docs/framework/lit/guides/infinite-queries.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ An infinite query result contains:
1616
## Load More Example
1717

1818
```ts
19-
import { LitElement, html } from 'lit'
2019
import { createInfiniteQueryController } from '@tanstack/lit-query'
20+
import { LitElement, html } from 'lit'
2121

2222
class ProjectsList extends LitElement {
2323
private readonly projects = createInfiniteQueryController(this, {

‎docs/framework/lit/guides/mutations.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ title: Mutations
66
Unlike queries, mutations are used to create, update, delete, or otherwise perform server side effects. In Lit, use [`createMutationController`](../reference/functions/createMutationController.md).
77

88
```ts
9-
import { LitElement, html } from 'lit'
109
import {
1110
QueryClient,
1211
QueryClientProvider,
1312
createMutationController,
1413
createQueryController,
1514
} from '@tanstack/lit-query'
15+
import { LitElement, html } from 'lit'
1616

1717
const queryClient = new QueryClient()
1818

‎docs/framework/lit/guides/parallel-queries.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Parallel queries are queries that run at the same time so the UI does not wait f
1010
When the number of queries is fixed, create multiple query controllers on the same host. They will all subscribe when the host connects.
1111

1212
```ts
13-
import { LitElement, html } from 'lit'
1413
import { createQueryController } from '@tanstack/lit-query'
14+
import { LitElement, html } from 'lit'
1515

1616
class DashboardView extends LitElement {
1717
private readonly users = createQueryController(this, {
@@ -62,8 +62,8 @@ When the number of queries changes with host state, use [`createQueriesControlle
6262
Use an options getter when the query list depends on reactive host fields:
6363

6464
```ts
65-
import { LitElement, html } from 'lit'
6665
import { createQueriesController } from '@tanstack/lit-query'
66+
import { LitElement, html } from 'lit'
6767

6868
class UsersDetails extends LitElement {
6969
static properties = {

‎docs/framework/lit/guides/queries.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ A query is a declarative dependency on an asynchronous source of data tied to a
1212
In Lit, subscribe to a query with [`createQueryController`](../reference/functions/createQueryController.md):
1313

1414
```ts
15-
import { LitElement, html } from 'lit'
1615
import { createQueryController } from '@tanstack/lit-query'
16+
import { LitElement, html } from 'lit'
1717

1818
class TodosView extends LitElement {
1919
private readonly todos = createQueryController(this, {

‎docs/framework/lit/guides/ssr.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Never share one server `QueryClient` between users or requests.
2222
```ts
2323
import { render } from '@lit-labs/ssr'
2424
import { collectResult } from '@lit-labs/ssr/lib/render-result.js'
25-
import { html } from 'lit'
2625
import { QueryClient, dehydrate, noop } from '@tanstack/lit-query'
26+
import { html } from 'lit'
2727
import { dataQueries } from './services/data/queries.js'
2828
import './app.js'
2929

@@ -107,8 +107,8 @@ window.addEventListener(
107107
The SSR example creates its controller only after a `queryClient` property is available:
108108

109109
```ts
110-
import { LitElement } from 'lit'
111110
import { createQueryController } from '@tanstack/lit-query'
111+
import { LitElement } from 'lit'
112112
import { dataQueries } from './services/data/queries.js'
113113
import type { QueryClient, QueryResultAccessor } from '@tanstack/lit-query'
114114
import type { DataResponse } from './services/data/types.js'

0 commit comments

Comments
 (0)