Skip to content

Commit 205997a

Browse files
committed
Format code with ESLint
1 parent aa75ac5 commit 205997a

File tree

105 files changed

+308
-262
lines changed

Some content is hidden

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

105 files changed

+308
-262
lines changed

src/api/__tests__/app-disposer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import type { App } from "vue";
33
/**
44
* A class that wraps an application and implements the Disposable interface.
55
* It provides a way to properly unmount the app when the instance is disposed.
6-
*
6+
*
77
* This class is designed to be used with the `using` statement, which will
88
* automatically unmount the app when the block exits.
9-
*
9+
*
1010
* @example
1111
* ```
1212
* {
@@ -47,4 +47,4 @@ if (import.meta.vitest) {
4747

4848
expect(mockApp.unmount).toHaveBeenCalledTimes(1);
4949
});
50-
}
50+
}

src/api/__tests__/example-use-query.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Client, CombinedError, provideClient, useQuery } from "@urql/vue";
2-
import gql from "graphql-tag";
31
import { describe, expect, it } from "vitest";
42
import type { App, MaybeRef } from "vue";
53
import { createApp, defineComponent, ref } from "vue";
4+
import { Client, CombinedError, provideClient, useQuery } from "@urql/vue";
5+
import gql from "graphql-tag";
66
import { fromValue, never } from "wonka";
77

88
type SetupFunction = () => Record<string, unknown>;

src/api/__tests__/scratch.spec.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Client, CombinedError } from "@urql/vue";
21
import { describe, expect, it, vi } from "vitest";
32
import type { MaybeRef } from "vue";
43
import { ref } from "vue";
4+
import { Client, CombinedError } from "@urql/vue";
55
import type { Subject } from "wonka";
66
import { fromValue, makeSubject, never } from "wonka";
77

@@ -13,7 +13,7 @@ import { useInSetupWithUrqlClient } from "./setup-with-client";
1313
function useQueryFromClient(client: MaybeRef<Client>) {
1414
const disposable = useInSetupWithUrqlClient(
1515
() => useCtrlStateQuery({ variables: {} }),
16-
client
16+
client,
1717
);
1818
const { ret: query } = disposable;
1919
return { query, [Symbol.dispose]: () => disposable[Symbol.dispose]() };
@@ -47,7 +47,9 @@ describe("useCtrlStateQuery with mock client", () => {
4747
});
4848

4949
it("error", async () => {
50-
const error = new CombinedError({ networkError: Error("something went wrong!") });
50+
const error = new CombinedError({
51+
networkError: Error("something went wrong!"),
52+
});
5153
const executeQuery = vi.fn(() => fromValue({ error }));
5254
const client = ref({ executeQuery });
5355
using res = useQueryFromClient(client as any);
@@ -80,7 +82,9 @@ describe("useCtrlStateQuery with mock client", () => {
8082
});
8183

8284
it("error after fetching", async () => {
83-
const error = new CombinedError({ networkError: Error("something went wrong!") });
85+
const error = new CombinedError({
86+
networkError: Error("something went wrong!"),
87+
});
8488
const subject: Subject<{ data?: CtrlStateQuery; error?: Error }> = makeSubject();
8589
const executeQuery = vi.fn(() => subject.source);
8690
const client = ref({ executeQuery });

src/api/__tests__/setup-with-client.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1+
import type { MaybeRef } from "vue";
12
import type { Client } from "@urql/vue";
23
import { provideClient, useClientHandle } from "@urql/vue";
3-
import type { MaybeRef } from "vue";
44

55
import { setupNestedComponents } from "./setup-nested-components";
66

7-
87
/**
98
* Execute `func` in a Vue component `setup` in which the `client` can be injected.
109
*
1110
* @param func - Function to be executed
1211
* @param client - The urql client to be provided
13-
* @returns A disposable object containing the `func`'s return
12+
* @returns A disposable object containing the `func`'s return
1413
*/
1514
export function useInSetupWithUrqlClient<T>(func: () => T, client: MaybeRef<Client>) {
1615
let ret!: T;

src/api/__tests__/use-state-subscription.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
2+
13
import {
24
useCtrlStateQuery,
35
useCtrlStateSSubscription,
46
} from "@/graphql/codegen/generated";
5-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
7+
68
import { useSubscribeState } from "../use-state-subscription";
79

810
vi.mock("@/graphql/codegen/generated", () => ({

src/api/use-continuous-enabled-subscription.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import type { ComputedRef } from "vue";
2+
import { computed } from "vue";
3+
14
import {
25
useCtrlContinuousEnabledQuery,
36
useCtrlContinuousEnabledSSubscription,
47
} from "@/graphql/codegen/generated";
5-
import type { ComputedRef } from "vue";
6-
import { computed } from "vue";
78

89
interface _ContinuousEnabledSubscription {
910
continuousEnabled: ComputedRef<boolean | undefined>;
@@ -28,7 +29,7 @@ export function useSubscribeContinuousEnabled(): ContinuousEnabledSubscription {
2829
error.value
2930
? undefined
3031
: subscription.data?.value?.ctrlContinuousEnabled ||
31-
query.data?.value?.ctrl.continuousEnabled
32+
query.data?.value?.ctrl.continuousEnabled,
3233
);
3334

3435
const ret = { continuousEnabled, error, subscription, query };

src/api/use-run-no-subscription.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import type { ComputedRef } from "vue";
2+
import { computed } from "vue";
3+
14
import {
25
useCtrlRunNoQuery,
36
useCtrlRunNoSSubscription,
47
} from "@/graphql/codegen/generated";
5-
import type { ComputedRef } from "vue";
6-
import { computed } from "vue";
78

89
interface _RunNoSubscription {
910
runNo: ComputedRef<number | undefined>;
@@ -15,15 +16,18 @@ interface _RunNoSubscription {
1516
type RunNoSubscription = _RunNoSubscription & PromiseLike<_RunNoSubscription>;
1617

1718
export function useSubscribeRunNo(): RunNoSubscription {
18-
const query = useCtrlRunNoQuery({ requestPolicy: "network-only", variables: {} });
19+
const query = useCtrlRunNoQuery({
20+
requestPolicy: "network-only",
21+
variables: {},
22+
});
1923
const subscription = useCtrlRunNoSSubscription({ variables: {} });
2024

2125
const error = computed(() => subscription.error?.value || query.error?.value);
2226

2327
const runNo = computed(() =>
2428
error.value
2529
? undefined
26-
: subscription.data?.value?.ctrlRunNo || query.data?.value?.ctrl.runNo
30+
: subscription.data?.value?.ctrlRunNo || query.data?.value?.ctrl.runNo,
2731
);
2832

2933
const ret = { runNo, error, subscription, query };

src/api/use-schedule-auto-mode-mode-subscription.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import type { ComputedRef } from "vue";
2+
import { computed } from "vue";
3+
14
import {
25
useScheduleAutoModeModeQuery,
36
useScheduleAutoModeModeSSubscription,
47
} from "@/graphql/codegen/generated";
5-
import type { ComputedRef } from "vue";
6-
import { computed } from "vue";
78

89
// type AutoMode = "off" | "scheduler" | "queue";
910

@@ -30,7 +31,7 @@ export function useSubscribeScheduleAutoModeMode(): ScheduleAutoModeModeSubscrip
3031
error.value
3132
? undefined
3233
: subscription.data?.value?.scheduleAutoModeMode ||
33-
query.data?.value?.schedule.autoMode.mode
34+
query.data?.value?.schedule.autoMode.mode,
3435
);
3536

3637
const ret = { autoModeMode, error, subscription, query };

src/api/use-schedule-auto-mode-state-subscription.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import type { ComputedRef } from "vue";
2+
import { computed } from "vue";
3+
14
import {
25
useQScheduleAutoModeStateQuery,
36
useScheduleAutoModeStateSSubscription,
47
} from "@/graphql/codegen/generated";
5-
import type { ComputedRef } from "vue";
6-
import { computed } from "vue";
78

89
interface _ScheduleAutoModeStateSubscription {
910
autoModeState: ComputedRef<string | undefined>;
@@ -28,7 +29,7 @@ export function useSubscribeScheduleAutoModeState(): ScheduleAutoModeStateSubscr
2829
error.value
2930
? undefined
3031
: subscription.data?.value?.scheduleAutoModeState ||
31-
query.data?.value?.schedule.autoMode.state
32+
query.data?.value?.schedule.autoMode.state,
3233
);
3334

3435
const ret = { autoModeState, error, subscription, query };

src/api/use-schedule-queue-items-subscription.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import type { ComputedRef } from "vue";
2+
import { computed } from "vue";
3+
14
import type { ScheduleQueueItem } from "@/graphql/codegen/generated";
25
import {
36
useScheduleQueueItemsQuery,
47
useScheduleQueueItemsSSubscription,
58
} from "@/graphql/codegen/generated";
6-
import type { ComputedRef } from "vue";
7-
import { computed } from "vue";
89

910
interface _ScheduleQueueItemsSubscription {
1011
items: ComputedRef<ScheduleQueueItem[] | undefined>;
@@ -31,7 +32,7 @@ export function useSubscribeScheduleQueueItems(): ScheduleQueueItemsSubscription
3132
error.value
3233
? undefined
3334
: subscription.data?.value?.scheduleQueueItems ||
34-
query.data?.value?.schedule.queue.items
35+
query.data?.value?.schedule.queue.items,
3536
);
3637

3738
const ret = { items, loading, error, subscription, query };

0 commit comments

Comments
 (0)