Repository: eslint/eslint-github-bot
Pull request #221 (2025-06-02 11:24:01)

chore: update `.gitignore` and `eslint.config.js`
Hello,

In this PR, I've updated minor things in this repository.

1. I've added `*.vscode-workspace` and `.cursor` to `.gitignore`.
2. Bumped the version of `globals` and `eslint`.
3. Updated `eslint.config.js` to use `defineConfig` and `globalIgnores`.



Patch:
diff --git a/.gitignore b/.gitignore
index 8543b70..a2be1c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,8 @@ versions.json
 .cache
 /packages/**/node_modules
 /.vscode
+*.code-workspace
+.cursor
 .sublimelinterrc
 .svn
 /credentials.json
diff --git a/eslint.config.js b/eslint.config.js
index 7a31051..1642390 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -1,13 +1,12 @@
 "use strict";
 
+const { defineConfig, globalIgnores } = require("eslint/config");
 const eslintConfigESLint = require("eslint-config-eslint/cjs");
 const globals = require("globals");
 
-module.exports = [
-    ...eslintConfigESLint,
-    {
-        ignores: ["coverage/"]
-    },
+module.exports = defineConfig([
+    globalIgnores(["coverage/"]),
+    eslintConfigESLint,
     {
         rules: {
             camelcase: ["error", { properties: "never" }],
@@ -30,4 +29,4 @@ module.exports = [
             "n/no-unpublished-require": "off"
         }
     }
-];
+]);
diff --git a/package-lock.json b/package-lock.json
index 2565ad8..76f1292 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,10 +14,10 @@
         "probot": "^13.4.1"
       },
       "devDependencies": {
-        "eslint": "^9.18.0",
+        "eslint": "^9.28.0",
         "eslint-config-eslint": "^11.0.0",
         "fetch-mock": "^12.2.0",
-        "globals": "^13.24.0",
+        "globals": "^16.2.0",
         "jest": "^29.7.0",
         "lint-staged": "^13.2.1",
         "yorkie": "^2.0.0"
@@ -670,13 +670,13 @@
       }
     },
     "node_modules/@eslint/config-array": {
-      "version": "0.19.1",
-      "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz",
-      "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==",
+      "version": "0.20.0",
+      "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz",
+      "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==",
       "dev": true,
       "license": "Apache-2.0",
       "dependencies": {
-        "@eslint/object-schema": "^2.1.5",
+        "@eslint/object-schema": "^2.1.6",
         "debug": "^4.3.1",
         "minimatch": "^3.1.2"
       },
@@ -685,9 +685,9 @@
       }
     },
     "node_modules/@eslint/config-array/node_modules/debug": {
-      "version": "4.4.0",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
-      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
+      "version": "4.4.1",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
+      "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -709,10 +709,20 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/@eslint/config-helpers": {
+      "version": "0.2.2",
+      "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.2.tgz",
+      "integrity": "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "engines": {
+        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+      }
+    },
     "node_modules/@eslint/core": {
-      "version": "0.10.0",
-      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz",
-      "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==",
+      "version": "0.14.0",
+      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.14.0.tgz",
+      "integrity": "sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==",
       "dev": true,
       "license": "Apache-2.0",
       "dependencies": {
@@ -723,9 +733,9 @@
       }
     },
     "node_modules/@eslint/eslintrc": {
-      "version": "3.2.0",
-      "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz",
-      "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==",
+      "version": "3.3.1",
+      "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz",
+      "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -754,9 +764,9 @@
       "license": "Python-2.0"
     },
     "node_modules/@eslint/eslintrc/node_modules/debug": {
-      "version": "4.4.0",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
-      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
+      "version": "4.4.1",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
+      "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -805,19 +815,22 @@
       "license": "MIT"
     },
     "node_modules/@eslint/js": {
-      "version": "9.18.0",
-      "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.18.0.tgz",
-      "integrity": "sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==",
+      "version": "9.28.0",
+      "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.28.0.tgz",
+      "integrity": "sha512-fnqSjGWd/CoIp4EXIxWVK/sHA6DOHN4+8Ix2cX5ycOY7LG0UY8nHCU5pIp2eaE1Mc7Qd8kHspYNzYXT2ojPLzg==",
       "dev": true,
       "license": "MIT",
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+      },
+      "funding": {
+        "url": "https://eslint.org/donate"
       }
     },
     "node_modules/@eslint/object-schema": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz",
-      "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==",
+      "version": "2.1.6",
+      "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz",
+      "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==",
       "dev": true,
       "license": "Apache-2.0",
       "engines": {
@@ -825,13 +838,13 @@
       }
     },
     "node_modules/@eslint/plugin-kit": {
-      "version": "0.2.5",
-      "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz",
-      "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==",
+      "version": "0.3.1",
+      "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.1.tgz",
+      "integrity": "sha512-0J+zgWxHN+xXONWIyPWKFMgVuJoZuGiIFu8yxk7RJjxkzpGmyja5wRFqZIVtjDVOQpV+Rw0iOAjYPE2eQyjr0w==",
       "dev": true,
       "license": "Apache-2.0",
       "dependencies": {
-        "@eslint/core": "^0.10.0",
+        "@eslint/core": "^0.14.0",
         "levn": "^0.4.1"
       },
       "engines": {
@@ -895,9 +908,9 @@
       }
     },
     "node_modules/@humanwhocodes/retry": {
-      "version": "0.4.1",
-      "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz",
-      "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==",
+      "version": "0.4.3",
+      "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz",
+      "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",
       "dev": true,
       "license": "Apache-2.0",
       "engines": {
@@ -3808,22 +3821,23 @@
       }
     },
     "node_modules/eslint": {
-      "version": "9.18.0",
-      "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz",
-      "integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==",
+      "version": "9.28.0",
+      "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.28.0.tgz",
+      "integrity": "sha512-ocgh41VhRlf9+fVpe7QKzwLj9c92fDiqOj8Y3Sd4/ZmVA4Btx4PlUYPq4pp9JDyupkf1upbEXecxL2mwNV7jPQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
         "@eslint-community/eslint-utils": "^4.2.0",
         "@eslint-community/regexpp": "^4.12.1",
-        "@eslint/config-array": "^0.19.0",
-        "@eslint/core": "^0.10.0",
-        "@eslint/eslintrc": "^3.2.0",
-        "@eslint/js": "9.18.0",
-        "@eslint/plugin-kit": "^0.2.5",
+        "@eslint/config-array": "^0.20.0",
+        "@eslint/config-helpers": "^0.2.1",
+        "@eslint/core": "^0.14.0",
+        "@eslint/eslintrc": "^3.3.1",
+        "@eslint/js": "9.28.0",
+        "@eslint/plugin-kit": "^0.3.1",
         "@humanfs/node": "^0.16.6",
         "@humanwhocodes/module-importer": "^1.0.1",
-        "@humanwhocodes/retry": "^0.4.1",
+        "@humanwhocodes/retry": "^0.4.2",
         "@types/estree": "^1.0.6",
         "@types/json-schema": "^7.0.15",
         "ajv": "^6.12.4",
@@ -3831,7 +3845,7 @@
         "cross-spawn": "^7.0.6",
         "debug": "^4.3.2",
         "escape-string-regexp": "^4.0.0",
-        "eslint-scope": "^8.2.0",
+        "eslint-scope": "^8.3.0",
         "eslint-visitor-keys": "^4.2.0",
         "espree": "^10.3.0",
         "esquery": "^1.5.0",
@@ -4168,6 +4182,22 @@
         "url": "https://opencollective.com/eslint"
       }
     },
+    "node_modules/eslint-plugin-unicorn/node_modules/globals": {
+      "version": "13.24.0",
+      "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
+      "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "type-fest": "^0.20.2"
+      },
+      "engines": {
+        "node": ">=8"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
     "node_modules/eslint-plugin-unicorn/node_modules/js-yaml": {
       "version": "4.1.0",
       "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
@@ -4201,10 +4231,23 @@
         "node": ">=8"
       }
     },
+    "node_modules/eslint-plugin-unicorn/node_modules/type-fest": {
+      "version": "0.20.2",
+      "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
+      "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
+      "dev": true,
+      "license": "(MIT OR CC0-1.0)",
+      "engines": {
+        "node": ">=10"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
     "node_modules/eslint-scope": {
-      "version": "8.2.0",
-      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz",
-      "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==",
+      "version": "8.3.0",
+      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz",
+      "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==",
       "dev": true,
       "license": "BSD-2-Clause",
       "dependencies": {
@@ -4967,27 +5010,13 @@
       "dev": true
     },
     "node_modules/globals": {
-      "version": "13.24.0",
-      "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
-      "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
-      "dev": true,
-      "dependencies": {
-        "type-fest": "^0.20.2"
-      },
-      "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/globals/node_modules/type-fest": {
-      "version": "0.20.2",
-      "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
-      "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
+      "version": "16.2.0",
+      "resolved": "https://registry.npmjs.org/globals/-/globals-16.2.0.tgz",
+      "integrity": "sha512-O+7l9tPdHCU320IigZZPj5zmRCFG9xHmx9cU8FqU2Rp+JN714seHV+2S9+JslCpY4gJwU2vOGox0wzgae/MCEg==",
       "dev": true,
+      "license": "MIT",
       "engines": {
-        "node": ">=10"
+        "node": ">=18"
       },
       "funding": {
         "url": "https://github.com/sponsors/sindresorhus"
diff --git a/package.json b/package.json
index 42f838f..b346c26 100644
--- a/package.json
+++ b/package.json
@@ -27,10 +27,10 @@
     "probot": "^13.4.1"
   },
   "devDependencies": {
-    "eslint": "^9.18.0",
+    "eslint": "^9.28.0",
     "eslint-config-eslint": "^11.0.0",
     "fetch-mock": "^12.2.0",
-    "globals": "^13.24.0",
+    "globals": "^16.2.0",
     "jest": "^29.7.0",
     "lint-staged": "^13.2.1",
     "yorkie": "^2.0.0"
diff --git a/src/plugins/auto-assign/index.js b/src/plugins/auto-assign/index.js
index caf137f..ed71ba2 100644
--- a/src/plugins/auto-assign/index.js
+++ b/src/plugins/auto-assign/index.js
@@ -25,7 +25,7 @@ function isWillingToSubmitPR(body) {
     return body
         .toLowerCase()
         .includes(
-            "- [x] i am willing to submit a pull request to implement this change."
+            "- [x] i am willing to submit a pull request"
         );
 }
 


Test patch:
diff --git a/tests/plugins/auto-assign/index.js b/tests/plugins/auto-assign/index.js
index 61e37f4..88f6f29 100644
--- a/tests/plugins/auto-assign/index.js
+++ b/tests/plugins/auto-assign/index.js
@@ -16,7 +16,21 @@ const autoAssign = require("../../../src/plugins/auto-assign");
 // Helpers
 //-----------------------------------------------------------------------------
 
-const API_ROOT = "https://api.github.com";
+const API_URL = "https://api.github.com/repos/test/repo-test/issues/1/assignees";
+
+/**
+ * Returns an array of strings representing the issue body.
+ * @param {'x' | ''} checkMark Check mark to use in the issue body.
+ * @returns {string[]} Array of strings representing the issue body.
+ */
+function issueBodies(checkMark) {
+    return [
+       `- [${checkMark}] I am willing to submit a pull request for this issue.`,
+       `- [${checkMark}] I am willing to submit a pull request for this change.`,
+       `- [${checkMark}] I am willing to submit a pull request to implement this rule.`,
+       `- [${checkMark}] I am willing to submit a pull request to implement this change.`
+    ]
+}
 
 //-----------------------------------------------------------------------------
 // Tests
@@ -37,6 +51,11 @@ describe("auto-assign", () => {
         });
 
         autoAssign(bot);
+
+        fetchMock.mockGlobal().post(
+            API_URL,
+            { status: 200 }
+        );
     });
 
     afterEach(() => {
@@ -47,62 +66,61 @@ describe("auto-assign", () => {
 
     describe("issue opened", () => {
         test("assigns issue to author when they indicate willingness to submit PR", async () => {
-            fetchMock.mockGlobal().post(
-                `${API_ROOT}/repos/test/repo-test/issues/1/assignees`,
-                { status: 200 }
-            );
-
-            await bot.receive({
-                name: "issues",
-                payload: {
-                    action: "opened",
-                    installation: {
-                        id: 1
-                    },
-                    issue: {
-                        number: 1,
-                        body: "- [x] I am willing to submit a pull request to implement this change.",
-                        user: {
-                            login: "user-a"
-                        }
-                    },
-                    repository: {
-                        name: "repo-test",
-                        owner: {
-                            login: "test"
+            for (const body of issueBodies("x")) {
+                await bot.receive({
+                    name: "issues",
+                    payload: {
+                        action: "opened",
+                        installation: {
+                            id: 1
+                        },
+                        issue: {
+                            number: 1,
+                            body,
+                            user: {
+                                login: "user-a"
+                            }
+                        },
+                        repository: {
+                            name: "repo-test",
+                            owner: {
+                                login: "test"
+                            }
                         }
                     }
-                }
-            });
+                });
 
-            expect(fetchMock.callHistory.called(`${API_ROOT}/repos/test/repo-test/issues/1/assignees`)).toBeTruthy();
+                expect(fetchMock.callHistory.called(API_URL)).toBeTruthy();
+            }
         });
 
         test("does not assign issue when author does not indicate willingness to submit PR", async () => {
-            await bot.receive({
-                name: "issues",
-                payload: {
-                    action: "opened",
-                    installation: {
-                        id: 1
-                    },
-                    issue: {
-                        number: 1,
-                        body: "- [] I am willing to submit a pull request to implement this change.",
-                        user: {
-                            login: "user-a"
-                        }
-                    },
-                    repository: {
-                        name: "repo-test",
-                        owner: {
-                            login: "test"
+            for (const body of issueBodies("")) {
+                await bot.receive({
+                    name: "issues",
+                    payload: {
+                        action: "opened",
+                        installation: {
+                            id: 1
+                        },
+                        issue: {
+                            number: 1,
+                            body,
+                            user: {
+                                login: "user-a"
+                            }
+                        },
+                        repository: {
+                            name: "repo-test",
+                            owner: {
+                                login: "test"
+                            }
                         }
                     }
-                }
-            });
+                });
 
-            expect(fetchMock.callHistory.called()).toBe(false);
+                expect(fetchMock.callHistory.called(API_URL)).toBe(false);
+            }
         });
     });
-}); 
\ No newline at end of file
+});