Skip to content

Commit

Permalink
Apply Prettier (#11111)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
phryneas committed Aug 1, 2023
1 parent f766e83 commit ba3e7d9
Show file tree
Hide file tree
Showing 188 changed files with 16,401 additions and 14,589 deletions.
5 changes: 1 addition & 4 deletions .attw.json
@@ -1,6 +1,3 @@
{
"ignoreRules": [
"false-esm",
"cjs-resolves-to-esm"
]
"ignoreRules": ["false-esm", "cjs-resolves-to-esm"]
}
13 changes: 8 additions & 5 deletions .eslintrc
Expand Up @@ -24,11 +24,14 @@
"files": ["**/*.ts", "**/*.tsx"],
"excludedFiles": ["**/__tests__/**/*.*"],
"rules": {
"@typescript-eslint/consistent-type-imports": ["error", {
"prefer": "type-imports",
"disallowTypeAnnotations": false,
"fixStyle": "separate-type-imports"
}],
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"disallowTypeAnnotations": false,
"fixStyle": "separate-type-imports"
}
],
"@typescript-eslint/no-import-type-side-effects": "error",
"no-restricted-syntax": [
"error",
Expand Down
216 changes: 108 additions & 108 deletions .github/workflows/close-stale-issues.yml

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions .github/workflows/lock.yml
@@ -1,8 +1,8 @@
name: 'Lock Threads'
name: "Lock Threads"

on:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"

permissions:
issues: write
Expand All @@ -20,12 +20,12 @@ jobs:
with:
github-token: ${{ github.token }}
log-output: true
issue-inactive-days: '30'
exclude-any-issue-labels: 'discussion'
issue-inactive-days: "30"
exclude-any-issue-labels: "discussion"
issue-comment: >
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.
For general questions, we recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/apollo-client) or our [discord server](https://discord.gg/graphos).
pr-inactive-days: '30'
exclude-any-pr-labels: 'discussion'
pr-inactive-days: "30"
exclude-any-pr-labels: "discussion"
302 changes: 213 additions & 89 deletions .prettierignore
Expand Up @@ -15,95 +15,219 @@
# Ignore all mdx & md files:
*.mdx
*.md
*.har
*.snap

# Do not format anything automatically except files listed below
/*
node_modules/
.yalc/
.next/

!config/
config/*
!config/processInvariants.ts
# Ignore all files in /scripts directory
/scripts

!integration-tests/
!integration-tests/**

##### PATHS TO BE FORMATTED #####
!src/
src/*
!src/react/
src/react/*

!src/dev

# Allow src/react/cache/ApolloProvider
!src/react/context/
src/react/context/*
!src/react/context/ApolloProvider.tsx
!src/react/context/ApolloContext.ts
!src/react/context/__tests__/
src/react/context/__tests__/*
!src/react/context/__tests__/ApolloProvider.test.tsx

# Allow src/react/cache
!src/react/cache/

# Allow certain core files
!src/core
src/core/*
!src/core/__tests__/
src/core/tests/*
!src/core/__tests__/equalByQuery.ts
!src/core/equalByQuery.ts

# Allowed utilities
!src/utilities/
src/utilities/*
!src/utilities/promises/
!src/utilities/types/
src/utilities/types/*
!src/utilities/types/DeepOmit.ts
!src/utilities/types/DeepPartial.ts
!src/utilities/types/Primitive.ts
!src/utilities/common
src/utilities/common/*
!src/utilities/common/stripTypename.ts
!src/utilities/common/omitDeep.ts
!src/utilities/common/tap.ts
!src/utilities/common/__tests__/
src/utilities/common/__tests__/*
!src/utilities/common/__tests__/omitDeep.ts
!src/utilities/common/__tests__/stripTypename.ts
!src/utilities/globals
src/utilities/globals/*
!src/utilities/globals/invariantWrappers.ts
!src/utilities/graphql
src/utilities/graphql/*
!src/utilities/graphql/operations.ts
!src/utilities/graphql/print.ts
!src/utilities/graphql/DocumentTransform.ts
!src/utilities/graphql/__tests__/
src/utilities/graphql/__tests__/*
!src/utilities/graphql/__tests__/DocumentTransform.ts

# Allowed links
!src/link
src/link/*
!src/link/remove-typename

## Allowed React Hooks
!src/react/hooks/
src/react/hooks/*
!src/react/hooks/internal
!src/react/hooks/useSuspenseCache.ts
!src/react/hooks/useSuspenseQuery.ts
!src/react/hooks/useBackgroundQuery.ts

## Allowed React hook tests
!src/react/hooks/__tests__/
src/react/hooks/__tests__/*
!src/react/hooks/__tests__/useSuspenseQuery.test.tsx
!src/react/hooks/__tests__/useBackgroundQuery.test.tsx

## Allowed testing utils
!src/testing
src/testing/*
!src/testing/matchers
/src/__tests__/ApolloClient.ts
/src/__tests__/client.ts
/src/__tests__/exports.ts
/src/__tests__/fetchMore.ts
/src/__tests__/graphqlSubscriptions.ts
/src/__tests__/local-state/export.ts
/src/__tests__/local-state/general.ts
/src/__tests__/local-state/resolvers.ts
/src/__tests__/local-state/subscriptions.ts
/src/__tests__/mutationResults.ts
/src/__tests__/optimistic.ts
/src/__tests__/refetchQueries.ts
/src/__tests__/resultCacheCleaning.ts
/src/__tests__/subscribeToMore.ts
/src/cache/core/__tests__/cache.ts
/src/cache/core/cache.ts
/src/cache/core/types/Cache.ts
/src/cache/core/types/DataProxy.ts
/src/cache/core/types/common.ts
/src/cache/index.ts
/src/cache/inmemory/__tests__/cache.ts
/src/cache/inmemory/__tests__/diffAgainstStore.ts
/src/cache/inmemory/__tests__/entityStore.ts
/src/cache/inmemory/__tests__/fragmentMatcher.ts
/src/cache/inmemory/__tests__/fragmentRegistry.ts
/src/cache/inmemory/__tests__/helpers.ts
/src/cache/inmemory/__tests__/key-extractor.ts
/src/cache/inmemory/__tests__/object-canon.ts
/src/cache/inmemory/__tests__/optimistic.ts
/src/cache/inmemory/__tests__/policies.ts
/src/cache/inmemory/__tests__/readFromStore.ts
/src/cache/inmemory/__tests__/recordingCache.ts
/src/cache/inmemory/__tests__/roundtrip.ts
/src/cache/inmemory/__tests__/writeToStore.ts
/src/cache/inmemory/entityStore.ts
/src/cache/inmemory/fixPolyfills.native.ts
/src/cache/inmemory/fixPolyfills.ts
/src/cache/inmemory/fragmentRegistry.ts
/src/cache/inmemory/helpers.ts
/src/cache/inmemory/inMemoryCache.ts
/src/cache/inmemory/key-extractor.ts
/src/cache/inmemory/object-canon.ts
/src/cache/inmemory/policies.ts
/src/cache/inmemory/reactiveVars.ts
/src/cache/inmemory/readFromStore.ts
/src/cache/inmemory/types.ts
/src/cache/inmemory/writeToStore.ts
/src/config/jest/setup.ts
/src/core/ApolloClient.ts
/src/core/LocalState.ts
/src/core/ObservableQuery.ts
/src/core/QueryInfo.ts
/src/core/QueryManager.ts
/src/core/__tests__/LocalState.ts
/src/core/__tests__/ObservableQuery.ts
/src/core/__tests__/QueryManager/index.ts
/src/core/__tests__/QueryManager/links.ts
/src/core/__tests__/QueryManager/multiple-results.ts
/src/core/__tests__/QueryManager/recycler.ts
/src/core/__tests__/fetchPolicies.ts
/src/core/index.ts
/src/core/networkStatus.ts
/src/core/types.ts
/src/core/watchQueryOptions.ts
/src/errors/__tests__/ApolloError.ts
/src/errors/index.ts
/src/index.ts
/src/invariantErrorCodes.ts
/src/link/batch-http/__tests__/batchHttpLink.ts
/src/link/batch-http/batchHttpLink.ts
/src/link/batch-http/index.ts
/src/link/batch/__tests__/batchLink.ts
/src/link/batch/batchLink.ts
/src/link/batch/batching.ts
/src/link/batch/index.ts
/src/link/context/__tests__/index.ts
/src/link/context/index.ts
/src/link/core/ApolloLink.ts
/src/link/core/__tests__/ApolloLink.ts
/src/link/core/concat.ts
/src/link/core/empty.ts
/src/link/core/execute.ts
/src/link/core/from.ts
/src/link/core/index.ts
/src/link/core/split.ts
/src/link/core/types.ts
/src/link/error/__tests__/index.ts
/src/link/error/index.ts
/src/link/http/HttpLink.ts
/src/link/http/__tests__/HttpLink.ts
/src/link/http/__tests__/checkFetcher.ts
/src/link/http/__tests__/headerNormalization.ts
/src/link/http/__tests__/helpers.ts
/src/link/http/__tests__/parseAndCheckHttpResponse.ts
/src/link/http/__tests__/responseIterator.ts
/src/link/http/__tests__/responseIteratorNoAsyncIterator.ts
/src/link/http/__tests__/selectHttpOptionsAndBody.ts
/src/link/http/__tests__/selectURI.ts
/src/link/http/__tests__/serializeFetchParameter.ts
/src/link/http/checkFetcher.ts
/src/link/http/createHttpLink.ts
/src/link/http/createSignalIfSupported.ts
/src/link/http/index.ts
/src/link/http/iterators/async.ts
/src/link/http/iterators/nodeStream.ts
/src/link/http/iterators/promise.ts
/src/link/http/iterators/reader.ts
/src/link/http/parseAndCheckHttpResponse.ts
/src/link/http/responseIterator.ts
/src/link/http/rewriteURIForGET.ts
/src/link/http/selectHttpOptionsAndBody.ts
/src/link/http/selectURI.ts
/src/link/http/serializeFetchParameter.ts
/src/link/persisted-queries/__tests__/persisted-queries.test.ts
/src/link/persisted-queries/__tests__/react.test.tsx
/src/link/persisted-queries/index.ts
/src/link/retry/__tests__/delayFunction.ts
/src/link/retry/__tests__/retryFunction.ts
/src/link/retry/__tests__/retryLink.ts
/src/link/retry/delayFunction.ts
/src/link/retry/index.ts
/src/link/retry/retryFunction.ts
/src/link/retry/retryLink.ts
/src/link/schema/__tests__/schemaLink.ts
/src/link/schema/index.ts
/src/link/subscriptions/__tests__/graphqlWsLink.ts
/src/link/subscriptions/index.ts
/src/link/utils/__tests__/filterOperationVariables.ts
/src/link/utils/__tests__/fromError.ts
/src/link/utils/__tests__/fromPromise.ts
/src/link/utils/__tests__/toPromise.ts
/src/link/utils/__tests__/validateOperation.ts
/src/link/utils/createOperation.ts
/src/link/utils/filterOperationVariables.ts
/src/link/utils/fromError.ts
/src/link/utils/fromPromise.ts
/src/link/utils/index.ts
/src/link/utils/throwServerError.ts
/src/link/utils/toPromise.ts
/src/link/utils/transformOperation.ts
/src/link/utils/validateOperation.ts
/src/link/ws/__tests__/webSocketLink.ts
/src/link/ws/index.ts
/src/testing/core/index.ts
/src/testing/core/itAsync.ts
/src/testing/core/mocking/mockClient.ts
/src/testing/core/mocking/mockFetch.ts
/src/testing/core/mocking/mockLink.ts
/src/testing/core/mocking/mockQueryManager.ts
/src/testing/core/mocking/mockSubscriptionLink.ts
/src/testing/core/mocking/mockWatchQuery.ts
/src/testing/core/observableToPromise.ts
/src/testing/core/subscribeAndCount.ts
/src/testing/core/wait.ts
/src/testing/core/withConsoleSpy.ts
/src/testing/core/wrap.ts
/src/testing/index.ts
/src/testing/react/MockedProvider.tsx
/src/testing/react/__tests__/MockedProvider.test.tsx
/src/testing/react/__tests__/mockSubscriptionLink.test.tsx
/src/utilities/common/__tests__/canUse.ts
/src/utilities/common/__tests__/cloneDeep.ts
/src/utilities/common/__tests__/compact.ts
/src/utilities/common/__tests__/maybeDeepFeeze.ts
/src/utilities/common/__tests__/mergeDeep.ts
/src/utilities/common/arrays.ts
/src/utilities/common/canUse.ts
/src/utilities/common/cloneDeep.ts
/src/utilities/common/compact.ts
/src/utilities/common/errorHandling.ts
/src/utilities/common/filterInPlace.ts
/src/utilities/common/incrementalResult.ts
/src/utilities/common/makeUniqueId.ts
/src/utilities/common/maybeDeepFreeze.ts
/src/utilities/common/mergeDeep.ts
/src/utilities/common/mergeOptions.ts
/src/utilities/common/objects.ts
/src/utilities/common/responseIterator.ts
/src/utilities/common/stringifyForDisplay.ts
/src/utilities/globals/global.ts
/src/utilities/globals/index.ts
/src/utilities/globals/maybe.ts
/src/utilities/graphql/__tests__/directives.ts
/src/utilities/graphql/__tests__/fragments.ts
/src/utilities/graphql/__tests__/getFromAST.ts
/src/utilities/graphql/__tests__/storeUtils.ts
/src/utilities/graphql/__tests__/transform.ts
/src/utilities/graphql/directives.ts
/src/utilities/graphql/fragments.ts
/src/utilities/graphql/getFromAST.ts
/src/utilities/graphql/storeUtils.ts
/src/utilities/graphql/transform.ts
/src/utilities/index.ts
/src/utilities/observables/Concast.ts
/src/utilities/observables/Observable.ts
/src/utilities/observables/__tests__/Concast.ts
/src/utilities/observables/__tests__/Observable.ts
/src/utilities/observables/__tests__/asyncMap.ts
/src/utilities/observables/__tests__/subclassing.ts
/src/utilities/observables/asyncMap.ts
/src/utilities/observables/iteration.ts
/src/utilities/observables/subclassing.ts
/src/utilities/policies/__tests__/relayStylePagination.test.ts
/src/utilities/policies/pagination.ts
/src/utilities/types/IsStrictlyAny.ts
/src/version.ts
8 changes: 8 additions & 0 deletions .prettierrc
@@ -0,0 +1,8 @@
{
"bracketSpacing": true,
"printWidth": 80,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5"
}

0 comments on commit ba3e7d9

Please sign in to comment.