From e8d29c0acba1b79aca25ab5a0e0e130e03bec99e Mon Sep 17 00:00:00 2001 From: Jack Herrington Date: Mon, 15 Jun 2026 12:47:07 -0700 Subject: [PATCH] chore(deps-dev): bump @vitest/eslint-plugin to 1.3.20 (supersedes #7701) Applies the intent of #7701 directly on top of main instead of merging that stale branch, which would have downgraded vitest to 3.2.4. The ^8.46.1 @typescript-eslint dependency resolves as a nested subtree, so the top-level typescript-eslint stack stays at 8.45.0 and vitest at 3.2.4. No .npmrc needed. 1.3.20 enables the prefer-called-exactly-once-with rule; the flagged test assertions are collapsed into toHaveBeenCalledExactlyOnceWith via eslint --fix + prettier. Co-Authored-By: Claude Opus 4.8 (1M context) --- package-lock.json | 224 +++++++++++++++++- package.json | 2 +- .../generate-autocompletion.test.ts | 5 +- tests/unit/lib/functions/registry.test.ts | 6 +- tests/unit/utils/init/config-github.test.ts | 6 +- 5 files changed, 225 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index e5e88f388a0..6c89006c24a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -152,7 +152,7 @@ "@types/ws": "^8.18.1", "@types/yauzl": "^2.10.3", "@vitest/coverage-v8": "^3.2.4", - "@vitest/eslint-plugin": "1.3.13", + "@vitest/eslint-plugin": "1.3.20", "c8": "^10.1.3", "cheerio": "^1.1.2", "dedent": "^1.7.2", @@ -1136,7 +1136,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.0", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8097,12 +8099,14 @@ } }, "node_modules/@vitest/eslint-plugin": { - "version": "1.3.13", + "version": "1.3.20", + "resolved": "https://registry.npmjs.org/@vitest/eslint-plugin/-/eslint-plugin-1.3.20.tgz", + "integrity": "sha512-0VkFSFjfAkNLkgWcfcrJjU+4CQs48LuYH/2zrjNhHPX6iD+SMJzX0aidzesBHmdgnyIxiz4jDM0rzhE9SkJqOw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "^8.41.0", - "@typescript-eslint/utils": "^8.24.1" + "@typescript-eslint/scope-manager": "^8.46.1", + "@typescript-eslint/utils": "^8.46.1" }, "peerDependencies": { "eslint": ">= 8.57.0", @@ -8118,6 +8122,212 @@ } } }, + "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/project-service": { + "version": "8.61.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.61.1.tgz", + "integrity": "sha512-PrC4JYGmR241lYnfhmKGTXkFqv8+ymbTFgSAY0fVXpY82/QkMw5TZPl+vGzuDDU2QYJk9fIDOBTntF+yDv9LEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.61.1", + "@typescript-eslint/types": "^8.61.1", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { + "version": "8.61.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.61.1.tgz", + "integrity": "sha512-L2bdIeoQS8FlKAvONAr20w6OcLXeB+qiDKbAooS9A0Ben+iSIkBef0FxqwKWYqt5sa0i4KJtxVyVmhMylKzF5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.61.1", + "@typescript-eslint/visitor-keys": "8.61.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.61.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.61.1.tgz", + "integrity": "sha512-UN/H4di+OO7EWx2ovME+8t31YO+KVnK0RRKEHR3kOt21/Ay8BOq3M1OMvWs5vNiqcFCYGYoxK3MXPZzmMUE+yg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/types": { + "version": "8.61.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.61.1.tgz", + "integrity": "sha512-G+CRlPqLv7Bz1IZVs03x5K59F1veqL0EJUROAdGhKsEq8qOiRiZbI+HUojPq5l0fEGOKModD9br6lObhB8zkoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.61.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.61.1.tgz", + "integrity": "sha512-u+oQD3BqYWPc8YV9Zab4vaJElJuwOLPRc10Jm1o/qS+6Qwen14HCWwx0Seo4LnSn2wxea2Ik8DxPt2/FHmuhrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.61.1", + "@typescript-eslint/tsconfig-utils": "8.61.1", + "@typescript-eslint/types": "8.61.1", + "@typescript-eslint/visitor-keys": "8.61.1", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "8.61.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.61.1.tgz", + "integrity": "sha512-1+P/3Dj6jvtybE1q0HQ6yBt/gq+oKJyLdEv4HdnqasaEXRSYCAsD59mXEVQnM/ULNdQxbX77tdG4jPRjIS6knA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.61.1", + "@typescript-eslint/types": "8.61.1", + "@typescript-eslint/typescript-estree": "8.61.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@vitest/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.61.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.61.1.tgz", + "integrity": "sha512-6fJ9MHWtK14C1DSkiMlHUSOmrVebL7150xZJBlJiL62jjhIA4JmOq6flwBgDxIdBKKdoiZRel+dfPD5MLfny3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.61.1", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@vitest/eslint-plugin/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@vitest/eslint-plugin/node_modules/brace-expansion": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@vitest/eslint-plugin/node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@vitest/eslint-plugin/node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vitest/eslint-plugin/node_modules/semver": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz", + "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@vitest/expect": { "version": "3.2.4", "dev": true, @@ -19323,7 +19533,9 @@ } }, "node_modules/ts-api-utils": { - "version": "2.1.0", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", "license": "MIT", "engines": { "node": ">=18.12" diff --git a/package.json b/package.json index abc6b7775f7..dda43192fd5 100644 --- a/package.json +++ b/package.json @@ -193,7 +193,7 @@ "@types/ws": "^8.18.1", "@types/yauzl": "^2.10.3", "@vitest/coverage-v8": "^3.2.4", - "@vitest/eslint-plugin": "1.3.13", + "@vitest/eslint-plugin": "1.3.20", "c8": "^10.1.3", "cheerio": "^1.1.2", "dedent": "^1.7.2", diff --git a/tests/unit/lib/completion/generate-autocompletion.test.ts b/tests/unit/lib/completion/generate-autocompletion.test.ts index eee478df48e..23726598975 100644 --- a/tests/unit/lib/completion/generate-autocompletion.test.ts +++ b/tests/unit/lib/completion/generate-autocompletion.test.ts @@ -34,13 +34,12 @@ describe('generateAutocompletion', () => { generateAutocompletion(program) - expect(fs.writeFileSync).toHaveBeenCalledOnce() - - expect(fs.writeFileSync).toHaveBeenCalledWith( + expect(fs.writeFileSync).toHaveBeenCalledExactlyOnceWith( expect.stringMatching(/autocompletion\.json$/), expect.anything(), 'utf-8', ) + expect(vi.mocked(fs.writeFileSync).mock.lastCall?.[1]).toMatchSnapshot() vi.mocked(fs.writeFileSync).mockRestore() diff --git a/tests/unit/lib/functions/registry.test.ts b/tests/unit/lib/functions/registry.test.ts index 4676fbfdb32..3db3d087c0a 100644 --- a/tests/unit/lib/functions/registry.test.ts +++ b/tests/unit/lib/functions/registry.test.ts @@ -75,8 +75,7 @@ test('registry should only pass functions config to zip-it-and-ship-it', async ( functionsRegistry.projectRoot, ]) - expect(listFunctionsStub).toHaveBeenCalledOnce() - expect(listFunctionsStub).toHaveBeenCalledWith( + expect(listFunctionsStub).toHaveBeenCalledExactlyOnceWith( expect.anything(), expect.objectContaining({ // @ts-expect-error FIXME(ndhoule): We should not be touching this private member in tests @@ -149,6 +148,5 @@ test('should add included_files to watcher', async () => { // @ts-expect-error FIXME(ndhoule): We should not be touching this private member in tests await registry.buildFunctionAndWatchFiles(func) - expect(watchDebounced).toHaveBeenCalledOnce() - expect(watchDebounced).toHaveBeenCalledWith(['myfile', 'include/*'], expect.anything()) + expect(watchDebounced).toHaveBeenCalledExactlyOnceWith(['myfile', 'include/*'], expect.anything()) }) diff --git a/tests/unit/utils/init/config-github.test.ts b/tests/unit/utils/init/config-github.test.ts index 76538567967..d70f2dd65ab 100644 --- a/tests/unit/utils/init/config-github.test.ts +++ b/tests/unit/utils/init/config-github.test.ts @@ -64,8 +64,7 @@ describe('getGitHubToken', () => { const token = await getGitHubToken({ globalConfig }) - expect(Octokit).toHaveBeenCalledOnce() - expect(Octokit).toHaveBeenCalledWith({ auth: 'token old_token' }) + expect(Octokit).toHaveBeenCalledExactlyOnceWith({ auth: 'token old_token' }) expect(token).toBe('old_token') expect(globalConfig.get(`users.spongebob.auth.github`)).toEqual({ @@ -87,8 +86,7 @@ describe('getGitHubToken', () => { }) const token = await getGitHubToken({ globalConfig }) - expect(Octokit).toHaveBeenCalledOnce() - expect(Octokit).toHaveBeenCalledWith({ auth: 'token old_token' }) + expect(Octokit).toHaveBeenCalledExactlyOnceWith({ auth: 'token old_token' }) expect(token).toBe('new_token') expect(globalConfig.get(`users.spongebob.auth.github`)).toEqual({