From 6ed916c8b7321f34781146b8fc4575cfaf9fe600 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Sun, 9 Aug 2026 22:39:15 +0800 Subject: [PATCH 1/2] feat: extend possibly unnecessary patterns --- app/utils/package-content-hints.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/utils/package-content-hints.ts b/app/utils/package-content-hints.ts index def5803552..790174f493 100644 --- a/app/utils/package-content-hints.ts +++ b/app/utils/package-content-hints.ts @@ -92,6 +92,8 @@ const POSSIBLY_UNNECESSARY_PATTERNS: readonly RegExp[] = [ /^(?:changelog|releasenotes|release-notes|history|contributing|contribute|news|collaborators)\.(?:md|markdown|txt)$/i, // Match example.mjs, examples.js, stc /^examples?\.(?:js|cjs|mjs|ts|mts|cts)$/, + /^playwright\.config\.(?:js|cjs|mjs|ts|mts|cts)$/, + /^vitest\.config\.(?:js|cjs|mjs|ts|mts|cts)$/, ] export function isPossiblyUnnecessaryContent(name: string, type: 'file' | 'directory'): boolean { From eff29bd54e822b1bd3aa5e6a77a46d5ee2c3163e Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Sun, 9 Aug 2026 22:59:34 +0800 Subject: [PATCH 2/2] test: update --- .../unit/app/utils/package-content-hints.spec.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/unit/app/utils/package-content-hints.spec.ts b/test/unit/app/utils/package-content-hints.spec.ts index 78732d1f48..a5e1d0b9a6 100644 --- a/test/unit/app/utils/package-content-hints.spec.ts +++ b/test/unit/app/utils/package-content-hints.spec.ts @@ -140,6 +140,22 @@ describe('isPossiblyUnnecessaryContent', () => { } }) + it('matches Playwright configuration patterns', () => { + for (const extension of ['js', 'cjs', 'mjs', 'ts', 'mts', 'cts']) { + expect(isPossiblyUnnecessaryContent(`playwright.config.${extension}`, 'file')).toBe(true) + } + expect(isPossiblyUnnecessaryContent('playwright.config.json', 'file')).toBe(false) + expect(isPossiblyUnnecessaryContent('playwright.config.txt', 'file')).toBe(false) + }) + + it('matches Vitest configuration patterns', () => { + for (const extension of ['js', 'cjs', 'mjs', 'ts', 'mts', 'cts']) { + expect(isPossiblyUnnecessaryContent(`vitest.config.${extension}`, 'file')).toBe(true) + } + expect(isPossiblyUnnecessaryContent('vitest.config.json', 'file')).toBe(false) + expect(isPossiblyUnnecessaryContent('vitest.config.txt', 'file')).toBe(false) + }) + it('matches common dot-prefixed configuration patterns without over-flagging', () => { expect(isPossiblyUnnecessaryContent('.babelrc', 'file')).toBe(true) for (const extension of ['json', 'js', 'cjs', 'mjs', 'yml', 'yaml', 'toml']) {