Skip to content

Commit ba3e7d9

Browse files
authored
Apply Prettier (#11111)
* flip .prettierignore to list ignored files * apply formatting to currently not-ignored files * upgrade prettier to v3 * apply agreed-up change to `"singleQuote": false` * move prettier config into file * format integration-tests * format config folder * ignore snap files per default * format the whole non-ignored repo * format `react` folder tests * format `react` folder
1 parent f766e83 commit ba3e7d9

File tree

188 files changed

+16401
-14589
lines changed

Some content is hidden

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

188 files changed

+16401
-14589
lines changed

.attw.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"ignoreRules": [
3-
"false-esm",
4-
"cjs-resolves-to-esm"
5-
]
2+
"ignoreRules": ["false-esm", "cjs-resolves-to-esm"]
63
}

.eslintrc

+8-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@
2424
"files": ["**/*.ts", "**/*.tsx"],
2525
"excludedFiles": ["**/__tests__/**/*.*"],
2626
"rules": {
27-
"@typescript-eslint/consistent-type-imports": ["error", {
28-
"prefer": "type-imports",
29-
"disallowTypeAnnotations": false,
30-
"fixStyle": "separate-type-imports"
31-
}],
27+
"@typescript-eslint/consistent-type-imports": [
28+
"error",
29+
{
30+
"prefer": "type-imports",
31+
"disallowTypeAnnotations": false,
32+
"fixStyle": "separate-type-imports"
33+
}
34+
],
3235
"@typescript-eslint/no-import-type-side-effects": "error",
3336
"no-restricted-syntax": [
3437
"error",

.github/workflows/close-stale-issues.yml

+108-108
Large diffs are not rendered by default.

.github/workflows/lock.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: 'Lock Threads'
1+
name: "Lock Threads"
22

33
on:
44
schedule:
5-
- cron: '0 0 * * *'
5+
- cron: "0 0 * * *"
66

77
permissions:
88
issues: write
@@ -20,12 +20,12 @@ jobs:
2020
with:
2121
github-token: ${{ github.token }}
2222
log-output: true
23-
issue-inactive-days: '30'
24-
exclude-any-issue-labels: 'discussion'
23+
issue-inactive-days: "30"
24+
exclude-any-issue-labels: "discussion"
2525
issue-comment: >
2626
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
2727
2828
For general questions, we recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/apollo-client) or our [discord server](https://discord.gg/graphos).
2929
30-
pr-inactive-days: '30'
31-
exclude-any-pr-labels: 'discussion'
30+
pr-inactive-days: "30"
31+
exclude-any-pr-labels: "discussion"

.prettierignore

+213-89
Original file line numberDiff line numberDiff line change
@@ -15,95 +15,219 @@
1515
# Ignore all mdx & md files:
1616
*.mdx
1717
*.md
18+
*.har
19+
*.snap
1820

19-
# Do not format anything automatically except files listed below
20-
/*
21+
node_modules/
22+
.yalc/
23+
.next/
2124

22-
!config/
23-
config/*
24-
!config/processInvariants.ts
25+
# Ignore all files in /scripts directory
26+
/scripts
2527

26-
!integration-tests/
27-
!integration-tests/**
28-
29-
##### PATHS TO BE FORMATTED #####
30-
!src/
31-
src/*
32-
!src/react/
33-
src/react/*
34-
35-
!src/dev
36-
37-
# Allow src/react/cache/ApolloProvider
38-
!src/react/context/
39-
src/react/context/*
40-
!src/react/context/ApolloProvider.tsx
41-
!src/react/context/ApolloContext.ts
42-
!src/react/context/__tests__/
43-
src/react/context/__tests__/*
44-
!src/react/context/__tests__/ApolloProvider.test.tsx
45-
46-
# Allow src/react/cache
47-
!src/react/cache/
48-
49-
# Allow certain core files
50-
!src/core
51-
src/core/*
52-
!src/core/__tests__/
53-
src/core/tests/*
54-
!src/core/__tests__/equalByQuery.ts
55-
!src/core/equalByQuery.ts
56-
57-
# Allowed utilities
58-
!src/utilities/
59-
src/utilities/*
60-
!src/utilities/promises/
61-
!src/utilities/types/
62-
src/utilities/types/*
63-
!src/utilities/types/DeepOmit.ts
64-
!src/utilities/types/DeepPartial.ts
65-
!src/utilities/types/Primitive.ts
66-
!src/utilities/common
67-
src/utilities/common/*
68-
!src/utilities/common/stripTypename.ts
69-
!src/utilities/common/omitDeep.ts
70-
!src/utilities/common/tap.ts
71-
!src/utilities/common/__tests__/
72-
src/utilities/common/__tests__/*
73-
!src/utilities/common/__tests__/omitDeep.ts
74-
!src/utilities/common/__tests__/stripTypename.ts
75-
!src/utilities/globals
76-
src/utilities/globals/*
77-
!src/utilities/globals/invariantWrappers.ts
78-
!src/utilities/graphql
79-
src/utilities/graphql/*
80-
!src/utilities/graphql/operations.ts
81-
!src/utilities/graphql/print.ts
82-
!src/utilities/graphql/DocumentTransform.ts
83-
!src/utilities/graphql/__tests__/
84-
src/utilities/graphql/__tests__/*
85-
!src/utilities/graphql/__tests__/DocumentTransform.ts
86-
87-
# Allowed links
88-
!src/link
89-
src/link/*
90-
!src/link/remove-typename
91-
92-
## Allowed React Hooks
93-
!src/react/hooks/
94-
src/react/hooks/*
95-
!src/react/hooks/internal
96-
!src/react/hooks/useSuspenseCache.ts
97-
!src/react/hooks/useSuspenseQuery.ts
98-
!src/react/hooks/useBackgroundQuery.ts
99-
100-
## Allowed React hook tests
101-
!src/react/hooks/__tests__/
102-
src/react/hooks/__tests__/*
103-
!src/react/hooks/__tests__/useSuspenseQuery.test.tsx
104-
!src/react/hooks/__tests__/useBackgroundQuery.test.tsx
105-
106-
## Allowed testing utils
107-
!src/testing
108-
src/testing/*
109-
!src/testing/matchers
28+
/src/__tests__/ApolloClient.ts
29+
/src/__tests__/client.ts
30+
/src/__tests__/exports.ts
31+
/src/__tests__/fetchMore.ts
32+
/src/__tests__/graphqlSubscriptions.ts
33+
/src/__tests__/local-state/export.ts
34+
/src/__tests__/local-state/general.ts
35+
/src/__tests__/local-state/resolvers.ts
36+
/src/__tests__/local-state/subscriptions.ts
37+
/src/__tests__/mutationResults.ts
38+
/src/__tests__/optimistic.ts
39+
/src/__tests__/refetchQueries.ts
40+
/src/__tests__/resultCacheCleaning.ts
41+
/src/__tests__/subscribeToMore.ts
42+
/src/cache/core/__tests__/cache.ts
43+
/src/cache/core/cache.ts
44+
/src/cache/core/types/Cache.ts
45+
/src/cache/core/types/DataProxy.ts
46+
/src/cache/core/types/common.ts
47+
/src/cache/index.ts
48+
/src/cache/inmemory/__tests__/cache.ts
49+
/src/cache/inmemory/__tests__/diffAgainstStore.ts
50+
/src/cache/inmemory/__tests__/entityStore.ts
51+
/src/cache/inmemory/__tests__/fragmentMatcher.ts
52+
/src/cache/inmemory/__tests__/fragmentRegistry.ts
53+
/src/cache/inmemory/__tests__/helpers.ts
54+
/src/cache/inmemory/__tests__/key-extractor.ts
55+
/src/cache/inmemory/__tests__/object-canon.ts
56+
/src/cache/inmemory/__tests__/optimistic.ts
57+
/src/cache/inmemory/__tests__/policies.ts
58+
/src/cache/inmemory/__tests__/readFromStore.ts
59+
/src/cache/inmemory/__tests__/recordingCache.ts
60+
/src/cache/inmemory/__tests__/roundtrip.ts
61+
/src/cache/inmemory/__tests__/writeToStore.ts
62+
/src/cache/inmemory/entityStore.ts
63+
/src/cache/inmemory/fixPolyfills.native.ts
64+
/src/cache/inmemory/fixPolyfills.ts
65+
/src/cache/inmemory/fragmentRegistry.ts
66+
/src/cache/inmemory/helpers.ts
67+
/src/cache/inmemory/inMemoryCache.ts
68+
/src/cache/inmemory/key-extractor.ts
69+
/src/cache/inmemory/object-canon.ts
70+
/src/cache/inmemory/policies.ts
71+
/src/cache/inmemory/reactiveVars.ts
72+
/src/cache/inmemory/readFromStore.ts
73+
/src/cache/inmemory/types.ts
74+
/src/cache/inmemory/writeToStore.ts
75+
/src/config/jest/setup.ts
76+
/src/core/ApolloClient.ts
77+
/src/core/LocalState.ts
78+
/src/core/ObservableQuery.ts
79+
/src/core/QueryInfo.ts
80+
/src/core/QueryManager.ts
81+
/src/core/__tests__/LocalState.ts
82+
/src/core/__tests__/ObservableQuery.ts
83+
/src/core/__tests__/QueryManager/index.ts
84+
/src/core/__tests__/QueryManager/links.ts
85+
/src/core/__tests__/QueryManager/multiple-results.ts
86+
/src/core/__tests__/QueryManager/recycler.ts
87+
/src/core/__tests__/fetchPolicies.ts
88+
/src/core/index.ts
89+
/src/core/networkStatus.ts
90+
/src/core/types.ts
91+
/src/core/watchQueryOptions.ts
92+
/src/errors/__tests__/ApolloError.ts
93+
/src/errors/index.ts
94+
/src/index.ts
95+
/src/invariantErrorCodes.ts
96+
/src/link/batch-http/__tests__/batchHttpLink.ts
97+
/src/link/batch-http/batchHttpLink.ts
98+
/src/link/batch-http/index.ts
99+
/src/link/batch/__tests__/batchLink.ts
100+
/src/link/batch/batchLink.ts
101+
/src/link/batch/batching.ts
102+
/src/link/batch/index.ts
103+
/src/link/context/__tests__/index.ts
104+
/src/link/context/index.ts
105+
/src/link/core/ApolloLink.ts
106+
/src/link/core/__tests__/ApolloLink.ts
107+
/src/link/core/concat.ts
108+
/src/link/core/empty.ts
109+
/src/link/core/execute.ts
110+
/src/link/core/from.ts
111+
/src/link/core/index.ts
112+
/src/link/core/split.ts
113+
/src/link/core/types.ts
114+
/src/link/error/__tests__/index.ts
115+
/src/link/error/index.ts
116+
/src/link/http/HttpLink.ts
117+
/src/link/http/__tests__/HttpLink.ts
118+
/src/link/http/__tests__/checkFetcher.ts
119+
/src/link/http/__tests__/headerNormalization.ts
120+
/src/link/http/__tests__/helpers.ts
121+
/src/link/http/__tests__/parseAndCheckHttpResponse.ts
122+
/src/link/http/__tests__/responseIterator.ts
123+
/src/link/http/__tests__/responseIteratorNoAsyncIterator.ts
124+
/src/link/http/__tests__/selectHttpOptionsAndBody.ts
125+
/src/link/http/__tests__/selectURI.ts
126+
/src/link/http/__tests__/serializeFetchParameter.ts
127+
/src/link/http/checkFetcher.ts
128+
/src/link/http/createHttpLink.ts
129+
/src/link/http/createSignalIfSupported.ts
130+
/src/link/http/index.ts
131+
/src/link/http/iterators/async.ts
132+
/src/link/http/iterators/nodeStream.ts
133+
/src/link/http/iterators/promise.ts
134+
/src/link/http/iterators/reader.ts
135+
/src/link/http/parseAndCheckHttpResponse.ts
136+
/src/link/http/responseIterator.ts
137+
/src/link/http/rewriteURIForGET.ts
138+
/src/link/http/selectHttpOptionsAndBody.ts
139+
/src/link/http/selectURI.ts
140+
/src/link/http/serializeFetchParameter.ts
141+
/src/link/persisted-queries/__tests__/persisted-queries.test.ts
142+
/src/link/persisted-queries/__tests__/react.test.tsx
143+
/src/link/persisted-queries/index.ts
144+
/src/link/retry/__tests__/delayFunction.ts
145+
/src/link/retry/__tests__/retryFunction.ts
146+
/src/link/retry/__tests__/retryLink.ts
147+
/src/link/retry/delayFunction.ts
148+
/src/link/retry/index.ts
149+
/src/link/retry/retryFunction.ts
150+
/src/link/retry/retryLink.ts
151+
/src/link/schema/__tests__/schemaLink.ts
152+
/src/link/schema/index.ts
153+
/src/link/subscriptions/__tests__/graphqlWsLink.ts
154+
/src/link/subscriptions/index.ts
155+
/src/link/utils/__tests__/filterOperationVariables.ts
156+
/src/link/utils/__tests__/fromError.ts
157+
/src/link/utils/__tests__/fromPromise.ts
158+
/src/link/utils/__tests__/toPromise.ts
159+
/src/link/utils/__tests__/validateOperation.ts
160+
/src/link/utils/createOperation.ts
161+
/src/link/utils/filterOperationVariables.ts
162+
/src/link/utils/fromError.ts
163+
/src/link/utils/fromPromise.ts
164+
/src/link/utils/index.ts
165+
/src/link/utils/throwServerError.ts
166+
/src/link/utils/toPromise.ts
167+
/src/link/utils/transformOperation.ts
168+
/src/link/utils/validateOperation.ts
169+
/src/link/ws/__tests__/webSocketLink.ts
170+
/src/link/ws/index.ts
171+
/src/testing/core/index.ts
172+
/src/testing/core/itAsync.ts
173+
/src/testing/core/mocking/mockClient.ts
174+
/src/testing/core/mocking/mockFetch.ts
175+
/src/testing/core/mocking/mockLink.ts
176+
/src/testing/core/mocking/mockQueryManager.ts
177+
/src/testing/core/mocking/mockSubscriptionLink.ts
178+
/src/testing/core/mocking/mockWatchQuery.ts
179+
/src/testing/core/observableToPromise.ts
180+
/src/testing/core/subscribeAndCount.ts
181+
/src/testing/core/wait.ts
182+
/src/testing/core/withConsoleSpy.ts
183+
/src/testing/core/wrap.ts
184+
/src/testing/index.ts
185+
/src/testing/react/MockedProvider.tsx
186+
/src/testing/react/__tests__/MockedProvider.test.tsx
187+
/src/testing/react/__tests__/mockSubscriptionLink.test.tsx
188+
/src/utilities/common/__tests__/canUse.ts
189+
/src/utilities/common/__tests__/cloneDeep.ts
190+
/src/utilities/common/__tests__/compact.ts
191+
/src/utilities/common/__tests__/maybeDeepFeeze.ts
192+
/src/utilities/common/__tests__/mergeDeep.ts
193+
/src/utilities/common/arrays.ts
194+
/src/utilities/common/canUse.ts
195+
/src/utilities/common/cloneDeep.ts
196+
/src/utilities/common/compact.ts
197+
/src/utilities/common/errorHandling.ts
198+
/src/utilities/common/filterInPlace.ts
199+
/src/utilities/common/incrementalResult.ts
200+
/src/utilities/common/makeUniqueId.ts
201+
/src/utilities/common/maybeDeepFreeze.ts
202+
/src/utilities/common/mergeDeep.ts
203+
/src/utilities/common/mergeOptions.ts
204+
/src/utilities/common/objects.ts
205+
/src/utilities/common/responseIterator.ts
206+
/src/utilities/common/stringifyForDisplay.ts
207+
/src/utilities/globals/global.ts
208+
/src/utilities/globals/index.ts
209+
/src/utilities/globals/maybe.ts
210+
/src/utilities/graphql/__tests__/directives.ts
211+
/src/utilities/graphql/__tests__/fragments.ts
212+
/src/utilities/graphql/__tests__/getFromAST.ts
213+
/src/utilities/graphql/__tests__/storeUtils.ts
214+
/src/utilities/graphql/__tests__/transform.ts
215+
/src/utilities/graphql/directives.ts
216+
/src/utilities/graphql/fragments.ts
217+
/src/utilities/graphql/getFromAST.ts
218+
/src/utilities/graphql/storeUtils.ts
219+
/src/utilities/graphql/transform.ts
220+
/src/utilities/index.ts
221+
/src/utilities/observables/Concast.ts
222+
/src/utilities/observables/Observable.ts
223+
/src/utilities/observables/__tests__/Concast.ts
224+
/src/utilities/observables/__tests__/Observable.ts
225+
/src/utilities/observables/__tests__/asyncMap.ts
226+
/src/utilities/observables/__tests__/subclassing.ts
227+
/src/utilities/observables/asyncMap.ts
228+
/src/utilities/observables/iteration.ts
229+
/src/utilities/observables/subclassing.ts
230+
/src/utilities/policies/__tests__/relayStylePagination.test.ts
231+
/src/utilities/policies/pagination.ts
232+
/src/utilities/types/IsStrictlyAny.ts
233+
/src/version.ts

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"bracketSpacing": true,
3+
"printWidth": 80,
4+
"semi": true,
5+
"singleQuote": false,
6+
"tabWidth": 2,
7+
"trailingComma": "es5"
8+
}

0 commit comments

Comments
 (0)