PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: tannerlinsley/react-query (ts)

Issue:
[Typescript] Support for default query function
**Describe the bug**
Providing a default query function is not supported in Typescript. The option `queryFn` (as described [here](https://react-query.tanstack.com/docs/guides/default-query-function)) does not exists in the type `ReactQueryProviderConfig`.

**To Reproduce**
In a Typescript setting:
```typescript
<ReactQueryConfigProvider
  config={{
    queries: {
      queryFn: defaultQueryFn,
    },
  }}
>
```

**Additional context**
React-query version: 2.4.15


Pull request:
fix(types): add queryFn to ReactQueryProviderConfig
Fix #743

Patch:
diff --git a/src/core/queryCache.js b/src/core/queryCache.js
index 4b34fc0f2..813b7ef47 100644
--- a/src/core/queryCache.js
+++ b/src/core/queryCache.js
@@ -208,6 +208,9 @@ export function makeQueryCache({ frozen = isServer, defaultConfig } = {}) {
 
     let [queryKey, config, { force, throwOnError } = {}] = getQueryArgs(args)
 
+    // https://github.com/tannerlinsley/react-query/issues/652
+    config = { retry: false, ...config }
+
     try {
       const query = queryCache.buildQuery(queryKey, config)
       if (force || query.state.isStale) {
diff --git a/types/index.d.ts b/types/index.d.ts
index e1b3babbc..0a3f15bff 100644
--- a/types/index.d.ts
+++ b/types/index.d.ts
@@ -615,7 +615,9 @@ export interface QueryCache {
     queryKeyOrPredicateFn: QueryKeyOrPredicateFn,
     { exact }?: { exact?: boolean }
   ): void
-  getQuery(queryKeyOrPredicateFn: QueryKeyOrPredicateFn): CachedQuery<unknown> | undefined
+  getQuery(
+    queryKeyOrPredicateFn: QueryKeyOrPredicateFn
+  ): CachedQuery<unknown> | undefined
   getQueries(
     queryKeyOrPredicateFn: QueryKeyOrPredicateFn,
     { exact }?: { exact?: boolean }
@@ -671,6 +673,7 @@ export interface ReactQueryProviderConfig<TError = Error> {
     /** Defaults to the value of `suspense` if not defined otherwise */
     useErrorBoundary?: boolean
     refetchOnWindowFocus?: boolean
+    queryFn?: QueryFunction<unknown, AnyQueryKey>
     queryKeySerializerFn?: (
       queryKey: QueryKeyPart[] | string | false | undefined
     ) => [string, QueryKeyPart[]] | []


Test patch:
diff --git a/src/core/tests/queryCache.test.js b/src/core/tests/queryCache.test.js
index 9868fef23..74feba9ed 100644
--- a/src/core/tests/queryCache.test.js
+++ b/src/core/tests/queryCache.test.js
@@ -23,6 +23,20 @@ describe('queryCache', () => {
     ).not.toThrow()
   })
 
+  // https://github.com/tannerlinsley/react-query/issues/652
+  test('prefetchQuery should not retry by default', async () => {
+    await expect(
+      queryCache.prefetchQuery(
+        'key',
+        async () => {
+          throw new Error('error')
+        },
+        {},
+        { throwOnError: true }
+      )
+    ).rejects.toEqual(new Error('error'))
+  })
+
   test('prefetchQuery returns the cached data on cache hits', async () => {
     const fetchFn = () => Promise.resolve('data')
     const first = await queryCache.prefetchQuery('key', fetchFn)
Repository: jlongster/prettier (js)

Issue:
Trailing whitespaces
First of all, love the project. I'm using scalafmt to format scalacode and all the debates regarding lint and codestyle and nitpicks in PRs disappeared when enabling it. Really looking forward to this taking off!

Now to the issue. It seems that arrow functions are, at least in some cases, leaving a trailing whitespace when reformatted.

I've attached two examples off git diffs where it leaves a trailing comma for me.
![image](https://cloud.githubusercontent.com/assets/4514159/21851188/d50adc5a-d805-11e6-82b8-c6a033ec68a1.png)
![image](https://cloud.githubusercontent.com/assets/4514159/21851197/ddae94b4-d805-11e6-9d32-f1c269df3667.png)

If additional information is needed I'll try my best to get some more context.

Pull request:
Remove trailing whitespace in broken arrow function expressions.
Closes #103.

Patch:
diff --git a/src/printer.js b/src/printer.js
index 52b5adeee..9e41a6a39 100644
--- a/src/printer.js
+++ b/src/printer.js
@@ -336,10 +336,10 @@ function genericPrintNoParens(path, options, print) {
       ])));
     }
 
-    parts.push(" => ");
+    parts.push(" =>");
 
     return conditionalGroup([
-      concat([ concat(parts), path.call(print, "body") ]),
+      concat([ concat(parts), " ", path.call(print, "body") ]),
       concat([ concat(parts),
                indent(options.tabWidth,
                       concat([line, path.call(print, "body")]))])


Test patch:
diff --git a/tests/predicates-parsing/__snapshots__/jsfmt.spec.js.snap b/tests/predicates-parsing/__snapshots__/jsfmt.spec.js.snap
index 9b27dbfff..0bb77ba91 100644
--- a/tests/predicates-parsing/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/predicates-parsing/__snapshots__/jsfmt.spec.js.snap
@@ -113,7 +113,7 @@ var a1 = (x: mixed): %checks => x !== null;
 
 (x): %checks => x !== null;
 
-const insert_a_really_big_predicated_arrow_function_name_here = (x): %checks => 
+const insert_a_really_big_predicated_arrow_function_name_here = (x): %checks =>
   x !== null;
 
 declare var x;