PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: jsx-eslint/eslint-plugin-react (js)

Issue:
react/no-unknown-property: allow abbr on th
The `react/no-unknown-property` rule reports the `abbr` tag on `th` elements as invalid, which seems incorrect: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-abbr

Pull request:
[Fix] `no-unknown-property`: allow `abbr` on `<th>` and `<td>`
Fixes #3418

[https://www.w3resource.com/html/attributes/html-abbr-attribute.php]()

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c5c9253d..1d5324d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,11 +10,13 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
 * [`no-unknown-property`]: add `noModule` on `script` ([#3414][] @ljharb)
 * [`no-unknown-property`]: allow `onLoad` on `<object>` ([#3415][] @OleksiiKachan)
 * [`no-multi-comp`]: do not detect a function property returning only null as a component ([#3412][] @ljharb)
+* [`no-unknown-property`]: allow `abbr` on `<th>` and `<td>` ([#3419][] @OleksiiKachan)
 
 ### Changed
 
 * [Meta] npmignore markdownlint config ([#3413][] @jorrit)
 
+[#3419]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3419
 [#3416]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3416
 [#3415]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3415
 [#3414]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3414
diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js
index 26e39fd2..92f0257f 100644
--- a/lib/rules/no-unknown-property.js
+++ b/lib/rules/no-unknown-property.js
@@ -28,6 +28,7 @@ const DOM_ATTRIBUTE_NAMES = {
 };
 
 const ATTRIBUTE_TAGS_MAP = {
+  abbr: ['th', 'td'],
   checked: ['input'],
   // image is required for SVG support, all other tags are HTML.
   crossOrigin: ['script', 'img', 'video', 'audio', 'link', 'image'],


Test patch:
diff --git a/tests/lib/rules/no-unknown-property.js b/tests/lib/rules/no-unknown-property.js
index 911d2817..00060413 100644
--- a/tests/lib/rules/no-unknown-property.js
+++ b/tests/lib/rules/no-unknown-property.js
@@ -69,6 +69,8 @@ ruleTester.run('no-unknown-property', rule, {
     { code: '<object onLoad={bar} />' },
     { code: '<div allowFullScreen webkitAllowFullScreen mozAllowFullScreen />' },
     { code: '<table border="1" />' },
+    { code: '<th abbr="abbr" />' },
+    { code: '<td abbr="abbr" />' },
     {
       code: '<div allowTransparency="true" />',
       settings: {
@@ -549,5 +551,18 @@ ruleTester.run('no-unknown-property', rule, {
         },
       ],
     },
+    {
+      code: '<div abbr="abbr" />',
+      errors: [
+        {
+          messageId: 'invalidPropOnTag',
+          data: {
+            name: 'abbr',
+            tagName: 'div',
+            allowedTags: 'th, td',
+          },
+        },
+      ],
+    },
   ]),
 });
Repository: moscajs/aedes (js)

Issue:
subscribe/unsubscribe processed out of order when persistence is used
When a client subscribes and unsubscribes repeatedly to the same topic in quick succession, sometimes these are processed out of order, resulting in the client believing it has subscribed but it is actually not subscribed.

It looks like the root cause is that the subscribe handler may [complete synchronously](https://github.com/moscajs/aedes/blob/295538898deaa57edcd6f62c469a55dd02a3a58c/lib/handlers/subscribe.js#L104) but the unsubscribe handler always [completes asynchronously](https://github.com/moscajs/aedes/blob/295538898deaa57edcd6f62c469a55dd02a3a58c/lib/handlers/unsubscribe.js#L30), so it's possible for the unsubscription to complete after the subscription.

As a workaround, I have implemented a modified persistence which synchronously completes the unsubscribe call when the client is "clean".

Pull request:
fix: remove subs only when clean flag is false
Fixes #469 

Patch:
diff --git a/lib/handlers/unsubscribe.js b/lib/handlers/unsubscribe.js
index 6c75d9e..c616fc4 100644
--- a/lib/handlers/unsubscribe.js
+++ b/lib/handlers/unsubscribe.js
@@ -27,6 +27,10 @@ function handleUnsubscribe (client, packet, done) {
   }
 
   if (packet.messageId) {
+    if (client.clean) {
+      return actualUnsubscribe(client, packet, done)
+    }
+
     broker.persistence.removeSubscriptions(client, unsubscriptions, function (err) {
       if (err) {
         return done(err)


Test patch:
diff --git a/test/client-pub-sub.js b/test/client-pub-sub.js
index 92b9147..a01c21e 100644
--- a/test/client-pub-sub.js
+++ b/test/client-pub-sub.js
@@ -514,6 +514,36 @@ test('unsubscribe a client', function (t) {
   connect(setup(broker))
 })
 
+test('unsubscribe should not call removeSubscriptions when [clean=true]', function (t) {
+  t.plan(2)
+
+  const broker = aedes()
+  t.tearDown(broker.close.bind(broker))
+
+  broker.persistence.removeSubscriptions = function (client, subs, cb) {
+    cb(Error('remove subscription is called'))
+  }
+
+  broker.on('client', function (client) {
+    client.subscribe({
+      topic: 'hello',
+      qos: 1
+    }, function (err) {
+      t.error(err, 'no error')
+      client.unsubscribe({
+        unsubscriptions: [{
+          topic: 'hello',
+          qos: 1
+        }],
+        messageId: 42
+      }, function (err) {
+        t.error(err, 'no error')
+      })
+    })
+  })
+  connect(setup(broker), { clean: true })
+})
+
 test('unsubscribe throws error', function (t) {
   t.plan(2)
Repository: sveltejs/prettier-plugin-svelte (ts)

Issue:
Await then block destructuring syntax being reformatted to invalid syntax
When I have an await then block, that looks like this and I'm trying to destructure that data, the plugin seems to be removing the data part automatically.
![image](https://user-images.githubusercontent.com/7412443/141674261-86837d11-6a3b-4d93-955a-43151bcd82d8.png)

On saving the data gets removed
![image](https://user-images.githubusercontent.com/7412443/141674273-4fb99935-e01a-45bb-888d-ddfd1639b21a.png)

The response object looks like this
![image](https://user-images.githubusercontent.com/7412443/141674284-71d4b44a-427a-47c2-b132-08ecd0a821d5.png)
![image](https://user-images.githubusercontent.com/7412443/141674287-62d30754-1260-4d66-811b-2148a6639655.png)

The data property is an array of objects

This syntax should work as illustrated here:
https://replit.com/join/qwwgddonou-saikatdas3

![image](https://user-images.githubusercontent.com/7412443/141674398-5a78e38f-44fd-4b2e-a922-9f1e6bf554bb.png)


**System (please complete the following information):**
 - OS: Windows with WSL 2 and Ubuntu
 - IDE: VSCode
 - Plugin/Package: Svelte for VSCode

Pull request:
(fix) properly format nested array patterns
Fixes #259

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 685b51a..d3885fc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
 
 * (feat) Support `bracketSameLine` option and deprecate `svelteBracketNewLine` ([#251](https://github.com/sveltejs/prettier-plugin-svelte/pull/251))
 * (fix) Prevent script/style contents from being erased in certain cases ([#255](https://github.com/sveltejs/prettier-plugin-svelte/issues/255))
+* (fix) Properly format nested array patterns ([#259](https://github.com/sveltejs/prettier-plugin-svelte/issues/259))
 
 ## 2.4.0
 
diff --git a/src/print/index.ts b/src/print/index.ts
index e3a6a5b..6fcb09d 100644
--- a/src/print/index.ts
+++ b/src/print/index.ts
@@ -1066,7 +1066,7 @@ function expandNode(node: any): string {
         case 'ObjectPattern':
             return ' {' + node.properties.map(expandNode).join(',') + ' }';
         case 'Property':
-            if (node.value.type === 'ObjectPattern') {
+            if (node.value.type === 'ObjectPattern' || node.value.type === 'ArrayPattern') {
                 return ' ' + node.key.name + ':' + expandNode(node.value);
             } else if (node.value.type === 'Identifier' && node.key.name !== node.value.name) {
                 return expandNode(node.key) + ':' + expandNode(node.value);


Test patch:
diff --git a/test/printer/samples/nested-destructuring.html b/test/printer/samples/nested-destructuring.html
new file mode 100644
index 0000000..a908791
--- /dev/null
+++ b/test/printer/samples/nested-destructuring.html
@@ -0,0 +1,7 @@
+{#await thePromise}
+    <p>loading...</p>
+{:then { data: [theValue] }}
+    <p>the value is {theValue}</p>
+{:catch { data: [{ data: [theError] }] }}
+    <p>oh no! {theError.message}</p>
+{/await}
Repository: lucasbento/create-graphql (js)

Issue:
Improve Mutation templates to have a pre-ready Mongoose save/update
The generated templates should have a code to save or edit the record in `MutationAdd` and `MutationEdit`.

Pull request:
Improve mutation generated code
Fixes #40.

Patch:
diff --git a/packages/generator/src/mutation/templates/MutationAddWithSchema.js.template b/packages/generator/src/mutation/templates/MutationAddWithSchema.js.template
index fb26c35..0294f23 100644
--- a/packages/generator/src/mutation/templates/MutationAddWithSchema.js.template
+++ b/packages/generator/src/mutation/templates/MutationAddWithSchema.js.template
@@ -37,10 +37,17 @@ export default mutationWithClientMutationId({
       <%_ } -%>
     } = args;
 
+    // Create new record
+    const <%= camelCaseName %> = await new <%= name %>({
+      <%_ for (field of schema.fields) { -%>
+      <%- field.name %>,
+      <%_ } -%>
+    }).save();
+
     // TODO: mutation logic
 
     return {
-      // id: id, // ID of the newly created row
+      id: <%= camelCaseName %>._id,
       error: null,
     };
   },
diff --git a/packages/generator/src/mutation/templates/MutationEditWithSchema.js.template b/packages/generator/src/mutation/templates/MutationEditWithSchema.js.template
index eeab1bf..ace5b9c 100644
--- a/packages/generator/src/mutation/templates/MutationEditWithSchema.js.template
+++ b/packages/generator/src/mutation/templates/MutationEditWithSchema.js.template
@@ -53,6 +53,13 @@ export default mutationWithClientMutationId({
       throw new Error('Invalid <%= camelCaseName %>Id');
     }
 
+    // Edit record
+    await <%= camelCaseName %>.update({
+      <%_ for (field of schema.fields) { -%>
+      <%- field.name %>,
+      <%_ } -%>
+    });
+
     // TODO: mutation logic
 
     // Clear dataloader cache


Test patch:
diff --git a/packages/generator/src/mutation/__tests__/__snapshots__/MutationGenerator.spec.js.snap b/packages/generator/src/mutation/__tests__/__snapshots__/MutationGenerator.spec.js.snap
index af0822a..12341d5 100644
--- a/packages/generator/src/mutation/__tests__/__snapshots__/MutationGenerator.spec.js.snap
+++ b/packages/generator/src/mutation/__tests__/__snapshots__/MutationGenerator.spec.js.snap
@@ -294,10 +294,17 @@ export default mutationWithClientMutationId({
       slug,
     } = args;
 
+    // Create new record
+    const post = await new Post({
+      title,
+      user,
+      slug,
+    }).save();
+
     // TODO: mutation logic
 
     return {
-      // id: id, // ID of the newly created row
+      id: post._id,
       error: null,
     };
   },
@@ -455,6 +462,13 @@ export default mutationWithClientMutationId({
       throw new Error(\'Invalid postId\');
     }
 
+    // Edit record
+    await post.update({
+      title,
+      user,
+      slug,
+    });
+
     // TODO: mutation logic
 
     // Clear dataloader cache
Repository: tomekpiotrowski/lets_expect (rust)

Issue:
Use commas instead of semis in `when` variable declarations

Pull request:
Use commas instead of semis in `when` variable declarations
Fixes #25

Patch:
diff --git a/lets_expect_core/src/core/when.rs b/lets_expect_core/src/core/when.rs
index 1cf8b0b..e87f21d 100644
--- a/lets_expect_core/src/core/when.rs
+++ b/lets_expect_core/src/core/when.rs
@@ -1,7 +1,7 @@
 use crate::core::to_ident::local_to_ident;
 use proc_macro2::{Ident, Span, TokenStream};
 use syn::punctuated::Punctuated;
-use syn::token::{Paren, Semi};
+use syn::token::{Comma, Paren};
 use syn::{braced, parenthesized, parse::Parse};
 
 use super::context::Context;
@@ -90,7 +90,7 @@ fn parse_lets_in_parentheses(
     let content;
     parenthesized!(content in input);
 
-    let when_lets: Punctuated<WhenLet, Semi> = Punctuated::parse_separated_nonempty(&content)?;
+    let when_lets: Punctuated<WhenLet, Comma> = Punctuated::parse_separated_nonempty(&content)?;
     let lets: Vec<Local> = when_lets.iter().map(WhenLet::to_local).collect();
 
     if lets.is_empty() {
diff --git a/src/lib.rs b/src/lib.rs
index 9f10d7a..d91cde3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -94,7 +94,7 @@
 //!         }
 //!     }
 //!
-//!     when(title = invalid_title; category_id = valid_category) { to be_err }
+//!     when(title = invalid_title, category_id = valid_category) { to be_err }
 //! }
 //! # }
 //! # }
@@ -370,7 +370,7 @@
 //!             to equal(10)
 //!         }
 //!
-//!         when(a = 10; b = 10) {
+//!         when(a = 10, b = 10) {
 //!             to equal(25)
 //!         }
 //!     }


Test patch:
diff --git a/tests/when.rs b/tests/when.rs
index 6701feb..29e8563 100644
--- a/tests/when.rs
+++ b/tests/when.rs
@@ -6,7 +6,7 @@ mod tests {
         expect(a + b + c) {
             when(a = 2) {
                 when (
-                    b = 1;
+                    b = 1,
                     c = 1
                 ) {
                     to equal_4 {
@@ -16,7 +16,7 @@ mod tests {
                 }
             }
 
-            when(a = 3; b = 3; c = 3) {
+            when(a = 3, b = 3, c = 3) {
                 to equal(9)
             }
 
@@ -36,5 +36,11 @@ mod tests {
                 to equal(-6)
             }
         }
+
+        expect(array) {
+            when(array = [1, 2, 3]) {
+                to equal([1, 2, 3])
+            }
+        }
     }
 }
Repository: jest-community/eslint-plugin-jest (ts)

Issue:
`prefer-to-be` considers `RegExp` literal notation as a literal
The [literal notation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#literal_notation_and_constructor) of a regular expression in JavaScript is still a `RegExp` object. But The `prefer-to-be` rule treats literal notation as a literal. So it auto-fixes `.toStrictEqual` into `.toBe`, causing tests to fail.

For example, given two tests that pass:

```ts
it('is an example', () => {
  const token: RegExp = new RegExp('[abc]+', 'gu');

  expect(token).toStrictEqual(/[abc]+/gu);
  expect(token).toStrictEqual(new RegExp('[abc]+', 'gu'));
});
```

Is changed into:

```ts
it('is an example', () => {
  const token: RegExp = new RegExp('[abc]+', 'gu');

  expect(token).toBe(/[abc]+/gu);
  expect(token).toStrictEqual(new RegExp('[abc]+', 'gu'));
});
```

And the `.toBe` test fails

Pull request:
fix(prefer-to-be): don't consider RegExp literals as `toBe`-able
Fixes #921 

Patch:
diff --git a/src/rules/prefer-to-be.ts b/src/rules/prefer-to-be.ts
index 687d774..a67fdb5 100644
--- a/src/rules/prefer-to-be.ts
+++ b/src/rules/prefer-to-be.ts
@@ -35,8 +35,11 @@ const isFirstArgumentIdentifier = (
   name: string,
 ) => isIdentifier(getFirstArgument(matcher), name);
 
-const isPrimitiveLiteral = (matcher: ParsedEqualityMatcherCall) =>
-  getFirstArgument(matcher).type === AST_NODE_TYPES.Literal;
+const isPrimitiveLiteral = (matcher: ParsedEqualityMatcherCall): boolean => {
+  const firstArg = getFirstArgument(matcher);
+
+  return firstArg.type === AST_NODE_TYPES.Literal && !('regex' in firstArg);
+};
 
 const getFirstArgument = (matcher: ParsedEqualityMatcherCall) => {
   return followTypeAssertionChain(matcher.arguments[0]);


Test patch:
diff --git a/src/rules/__tests__/prefer-to-be.test.ts b/src/rules/__tests__/prefer-to-be.test.ts
index 2cf92e6..bd9630d 100644
--- a/src/rules/__tests__/prefer-to-be.test.ts
+++ b/src/rules/__tests__/prefer-to-be.test.ts
@@ -14,6 +14,8 @@ ruleTester.run('prefer-to-be', rule, {
     'expect(value).toMatchSnapshot();',
     "expect(catchError()).toStrictEqual({ message: 'oh noes!' })",
     'expect("something");',
+    'expect(token).toStrictEqual(/[abc]+/g);',
+    "expect(token).toStrictEqual(new RegExp('[abc]+', 'g'));",
   ],
   invalid: [
     {