nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: vuejs/eslint-plugin-vue
Pull request #1088 (2020-03-31 14:04:05)

Fix detect Vue3 defineComponent
The `defineComponent` function is also a Vue3 component.

ref: https://vue-composition-api-rfc.netlify.com/api.html#definecomponent #1035


Patch:
diff --git a/lib/utils/index.js b/lib/utils/index.js
index e784f2ab..b302cd6c 100644
--- a/lib/utils/index.js
+++ b/lib/utils/index.js
@@ -550,6 +550,12 @@ module.exports = {
           const isAppVueComponent = isObjectArgument(node)
           return isAppVueComponent
         }
+        if (callee.name === 'defineComponent') {
+          // for Vue.js 3.x
+          // defineComponent({})
+          const isDestructedVueComponent = isObjectArgument(node)
+          return isDestructedVueComponent
+        }
       }
     }
 


Test patch:
diff --git a/tests/lib/rules/no-dupe-keys.js b/tests/lib/rules/no-dupe-keys.js
index 0844173f..a3bc06e7 100644
--- a/tests/lib/rules/no-dupe-keys.js
+++ b/tests/lib/rules/no-dupe-keys.js
@@ -639,6 +639,44 @@ ruleTester.run('no-dupe-keys', rule, {
         message: 'Duplicated key \'foo\'.',
         line: 9
       }]
+    },
+    {
+      filename: 'test.js',
+      code: `
+        defineComponent({
+          foo: {
+            bar: String
+          },
+          data: {
+            bar: null
+          },
+        })
+      `,
+      options: [{ groups: ['foo'] }],
+      parserOptions: { ecmaVersion: 6 },
+      errors: [{
+        message: 'Duplicated key \'bar\'.',
+        line: 7
+      }]
+    },
+    {
+      filename: 'test.js',
+      code: `
+        export default defineComponent({
+          foo: {
+            bar: String
+          },
+          data: {
+            bar: null
+          },
+        })
+      `,
+      options: [{ groups: ['foo'] }],
+      parserOptions: { ecmaVersion: 6, sourceType: 'module' },
+      errors: [{
+        message: 'Duplicated key \'bar\'.',
+        line: 7
+      }]
     }
   ]
 })
diff --git a/tests/lib/utils/vue-component.js b/tests/lib/utils/vue-component.js
index 69d663e9..794075d4 100644
--- a/tests/lib/utils/vue-component.js
+++ b/tests/lib/utils/vue-component.js
@@ -311,6 +311,12 @@ function invalidTests (ext) {
       `,
       parserOptions,
       errors: (ext === 'js' ? [] : [makeError(2)]).concat([makeError(8)])
+    },
+    {
+      filename: `test.${ext}`,
+      code: `export default defineComponent({})`,
+      parserOptions,
+      errors: [makeError(1)]
     }
   ]
 }
Repository: vuejs/eslint-plugin-vue
Pull request #1163 (2020-05-26 07:46:32)

Fixed false negatives when using ignorePattern for `vue/no-unused-var` rule.
Fixed an issue where variables before the one matching `ignorePattern` were not checked.


Patch:
diff --git a/lib/rules/no-unused-vars.js b/lib/rules/no-unused-vars.js
index 61aee3ff..37356c9c 100644
--- a/lib/rules/no-unused-vars.js
+++ b/lib/rules/no-unused-vars.js
@@ -35,31 +35,31 @@ module.exports = {
 
   create(context) {
     const option = context.options[0] || {}
-    const pattern = option.ignorePattern
-    let regExp = null
-    if (pattern) {
-      regExp = new RegExp(pattern, 'u')
+    const ignorePattern = option.ignorePattern
+    let ignoreRegEx = null
+    if (ignorePattern) {
+      ignoreRegEx = new RegExp(ignorePattern, 'u')
     }
     return utils.defineTemplateBodyVisitor(context, {
       VElement(node) {
         const variables = node.variables
-
-        for (
-          let i = variables.length - 1;
-          i >= 0 &&
-          !variables[i].references.length &&
-          // eslint-disable-next-line no-unmodified-loop-condition
-          (regExp === null || !regExp.test(variables[i].id.name));
-          i--
-        ) {
+        for (let i = variables.length - 1; i >= 0; i--) {
           const variable = variables[i]
+
+          if (variable.references.length) {
+            break
+          }
+
+          if (ignoreRegEx != null && ignoreRegEx.test(variable.id.name)) {
+            continue
+          }
           context.report({
             node: variable.id,
             loc: variable.id.loc,
             message: `'{{name}}' is defined but never used.`,
             data: variable.id,
             suggest:
-              pattern === '^_'
+              ignorePattern === '^_'
                 ? [
                     {
                       desc: `Replace the ${variable.id.name} with _${variable.id.name}`,


Test patch:
diff --git a/tests/lib/rules/no-unused-vars.js b/tests/lib/rules/no-unused-vars.js
index bf8a9377..0c1b85e5 100644
--- a/tests/lib/rules/no-unused-vars.js
+++ b/tests/lib/rules/no-unused-vars.js
@@ -157,6 +157,11 @@ tester.run('no-unused-vars', rule, {
     {
       code: '<template><div v-for="_i in foo" ></div></template>',
       errors: ["'_i' is defined but never used."]
+    },
+    {
+      code: '<template><div v-for="(a, _i) in foo" ></div></template>',
+      options: [{ ignorePattern: '^_' }],
+      errors: ["'a' is defined but never used."]
     }
   ]
 })
Repository: vuejs/eslint-plugin-vue
Pull request #1226 (2020-06-30 06:13:01)

Fixed no-side-effects-in-computed-properties when el is object
Hi, thanks for great plugin!

I'm using object property to set `el` of Vue.
However, I get a `TypeError` when I update eslint-plugin-vue to `v7.0.0-alpha.7` and run eslint.

for example:

```javascript
const dummy = { app: '#app' }

new Vue({
  el: dummy.app,
  template: '<p>test</p>',
});
```

```
TypeError: Cannot read property 'body' of undefined
```


I think the cause of this issue is that the `scopeStack` has no default value.
but, I’m not sure if this PR is the best solution.

Could you please review this PR or use another best solution to fix this issue?
Thanks.



Patch:
diff --git a/lib/rules/no-side-effects-in-computed-properties.js b/lib/rules/no-side-effects-in-computed-properties.js
index e6cd548e..761b1ac6 100644
--- a/lib/rules/no-side-effects-in-computed-properties.js
+++ b/lib/rules/no-side-effects-in-computed-properties.js
@@ -31,15 +31,9 @@ module.exports = {
   create(context) {
     /** @type {Map<ObjectExpression, ComponentComputedProperty[]>} */
     const computedPropertiesMap = new Map()
-    /**
-     * @typedef {object} ScopeStack
-     * @property {ScopeStack} upper
-     * @property {BlockStatement | Expression} body
-     */
-    /**
-     * @type {ScopeStack}
-     */
-    let scopeStack
+
+    /** @type { { upper: any, body: null | BlockStatement | Expression } } */
+    let scopeStack = { upper: null, body: null }
 
     /** @param {FunctionExpression | ArrowFunctionExpression | FunctionDeclaration} node */
     function onFunctionEnter(node) {


Test patch:
diff --git a/tests/lib/rules/no-side-effects-in-computed-properties.js b/tests/lib/rules/no-side-effects-in-computed-properties.js
index b2f341a1..40caaf0c 100644
--- a/tests/lib/rules/no-side-effects-in-computed-properties.js
+++ b/tests/lib/rules/no-side-effects-in-computed-properties.js
@@ -173,6 +173,13 @@ ruleTester.run('no-side-effects-in-computed-properties', rule, {
         }
       })`,
       parserOptions
+    },
+    {
+      code: `const test = { el: '#app' }
+        Vue.component('test', {
+        el: test.el
+      })`,
+      parserOptions
     }
   ],
   invalid: [
Repository: remix-run/remix
Pull request #3967 (2022-08-08 23:12:41)

tests: fix failing tests
Follow-up of #3902

changeset-bot[bot]: ###  ⚠️  No Changeset found

Latest commit: 9bf7c933ea083340abba1519f1d60d6de05000db

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. **If these changes should result in a version bump, you need to add a changeset.**

<details><summary>This PR includes no changesets</summary>

  When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

</details>

[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add a changeset to this PR](https://github.com/MichaelDeBoey/remix/new/fix-failing-tests?filename=.changeset/gold-clouds-run.md&value=---%0A%22remix%22%3A%20patch%0A%22%40remix-run%2Fdev%22%3A%20patch%0A---%0A%0Atests%3A%20fix%20failing%20tests%0A)



Patch:
diff --git a/packages/remix-dev/cli/run.ts b/packages/remix-dev/cli/run.ts
index 4e9c8454d..dfbcb94c5 100644
--- a/packages/remix-dev/cli/run.ts
+++ b/packages/remix-dev/cli/run.ts
@@ -107,10 +107,10 @@ ${colors.logoBlue("R")} ${colors.logoGreen("E")} ${colors.logoYellow(
   ${colors.heading("Start your server separately and watch for changes")}:
 
     # custom server start command, for example:
-      $ remix watch
+    $ remix watch
 
-      # in a separate tab:
-      $ node --inspect --require ./node_modules/dotenv/config --require ./mocks ./build/server.js
+    # in a separate tab:
+    $ node --inspect --require ./node_modules/dotenv/config --require ./mocks ./build/server.js
 
   ${colors.heading("Show all routes in your app")}:
 


Test patch:
diff --git a/packages/remix-dev/__tests__/cli-test.ts b/packages/remix-dev/__tests__/cli-test.ts
index ba727183b..90ed4f9b7 100644
--- a/packages/remix-dev/__tests__/cli-test.ts
+++ b/packages/remix-dev/__tests__/cli-test.ts
@@ -96,6 +96,7 @@ describe("remix CLI", () => {
             $ remix build [projectDir]
             $ remix dev [projectDir]
             $ remix routes [projectDir]
+            $ remix watch [projectDir]
             $ remix setup [remixPlatform]
             $ remix migrate [-m migration] [projectDir]
 
@@ -171,6 +172,14 @@ describe("remix CLI", () => {
             $ remix dev my-app
             $ remix dev --debug
 
+          Start your server separately and watch for changes:
+
+            # custom server start command, for example:
+            $ remix watch
+
+            # in a separate tab:
+            $ node --inspect --require ./node_modules/dotenv/config --require ./mocks ./build/server.js
+
           Show all routes in your app:
 
             $ remix routes