From c591b7414e0ed22bd53664b5cdbc95a47815d2bf Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 15 Jul 2026 14:24:33 +0100 Subject: [PATCH 1/4] feat: add more patterns to unnecessary files hints --- app/utils/package-content-hints.ts | 4 ++++ test/unit/app/utils/package-content-hints.spec.ts | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/app/utils/package-content-hints.ts b/app/utils/package-content-hints.ts index 8df8287950..0e15a6489b 100644 --- a/app/utils/package-content-hints.ts +++ b/app/utils/package-content-hints.ts @@ -11,8 +11,10 @@ const POSSIBLY_UNNECESSARY_FILES: ReadonlySet = new Set([ '.editorconfig', '.prettierignore', '.eslintignore', + '.jshintignore', '.gitignore', '.gitattributes', + '.travis.yml', 'tsconfig.json', '.node-version', '.nvmrc', @@ -27,6 +29,7 @@ const POSSIBLY_UNNECESSARY_FILES: ReadonlySet = new Set([ '.env.production.local', '.nycrc', 'nyc.json', + 'CHANGELOG.md' ]) const POSSIBLY_UNNECESSARY_DIRECTORIES: ReadonlySet = new Set([ @@ -40,6 +43,7 @@ const POSSIBLY_UNNECESSARY_DIRECTORIES: ReadonlySet = new Set([ '__tests__', 'spec', 'specs', + 'examples', ]) const POSSIBLY_UNNECESSARY_DIRECTORY_PATTERNS: readonly RegExp[] = [/^__.+__$/] diff --git a/test/unit/app/utils/package-content-hints.spec.ts b/test/unit/app/utils/package-content-hints.spec.ts index 770e33d4ea..ef9aaa9811 100644 --- a/test/unit/app/utils/package-content-hints.spec.ts +++ b/test/unit/app/utils/package-content-hints.spec.ts @@ -8,6 +8,7 @@ describe('isPossiblyUnnecessaryContent', () => { expect(isPossiblyUnnecessaryContent('.gitattributes', 'file')).toBe(true) expect(isPossiblyUnnecessaryContent('.prettierignore', 'file')).toBe(true) expect(isPossiblyUnnecessaryContent('.eslintignore', 'file')).toBe(true) + expect(isPossiblyUnnecessaryContent('.jshintignore', 'file')).toBe(true) expect(isPossiblyUnnecessaryContent('tsconfig.json', 'file')).toBe(true) }) @@ -30,6 +31,14 @@ describe('isPossiblyUnnecessaryContent', () => { expect(isPossiblyUnnecessaryContent('nyc.json', 'file')).toBe(true) }) + it('flags editor and CI files', () => { + expect(isPossiblyUnnecessaryContent('.travis.yml', 'file')).toBe(true) + }) + + it('flags changelog files', () => { + expect(isPossiblyUnnecessaryContent('CHANGELOG.md', 'file')).toBe(true) + }) + it('matches ESLint configuration patterns', () => { for (const extension of ['js', 'cjs', 'mjs', 'ts', 'mts', 'cts']) { expect(isPossiblyUnnecessaryContent(`eslint.config.${extension}`, 'file')).toBe(true) @@ -105,6 +114,10 @@ describe('isPossiblyUnnecessaryContent', () => { expect(isPossiblyUnnecessaryContent('specs', 'directory')).toBe(true) }) + it('flags example directories', () => { + expect(isPossiblyUnnecessaryContent('examples', 'directory')).toBe(true) + }) + it('does not flag ordinary source files or directories', () => { expect(isPossiblyUnnecessaryContent('index.js', 'file')).toBe(false) expect(isPossiblyUnnecessaryContent('package.json', 'file')).toBe(false) From 6b2882abdb9a4ac2b78a9deb74074cd57e648512 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 15 Jul 2026 13:27:37 +0000 Subject: [PATCH 2/4] [autofix.ci] apply automated fixes --- app/utils/package-content-hints.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/package-content-hints.ts b/app/utils/package-content-hints.ts index 0e15a6489b..dae2ee138d 100644 --- a/app/utils/package-content-hints.ts +++ b/app/utils/package-content-hints.ts @@ -29,7 +29,7 @@ const POSSIBLY_UNNECESSARY_FILES: ReadonlySet = new Set([ '.env.production.local', '.nycrc', 'nyc.json', - 'CHANGELOG.md' + 'CHANGELOG.md', ]) const POSSIBLY_UNNECESSARY_DIRECTORIES: ReadonlySet = new Set([ From 7b7cd38b1f9f544a3a7501372ac14c0e4efd7f14 Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 15 Jul 2026 14:32:11 +0100 Subject: [PATCH 3/4] feat: more patterns --- app/utils/package-content-hints.ts | 5 ++++- test/unit/app/utils/package-content-hints.spec.ts | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/utils/package-content-hints.ts b/app/utils/package-content-hints.ts index dae2ee138d..4e6b9bed69 100644 --- a/app/utils/package-content-hints.ts +++ b/app/utils/package-content-hints.ts @@ -30,6 +30,9 @@ const POSSIBLY_UNNECESSARY_FILES: ReadonlySet = new Set([ '.nycrc', 'nyc.json', 'CHANGELOG.md', + 'changelog.md', + 'CHANGELOG.markdown', + 'changelog.markdown', ]) const POSSIBLY_UNNECESSARY_DIRECTORIES: ReadonlySet = new Set([ @@ -40,9 +43,9 @@ const POSSIBLY_UNNECESSARY_DIRECTORIES: ReadonlySet = new Set([ '.zed', 'test', 'tests', - '__tests__', 'spec', 'specs', + 'example', 'examples', ]) diff --git a/test/unit/app/utils/package-content-hints.spec.ts b/test/unit/app/utils/package-content-hints.spec.ts index ef9aaa9811..92b7b0cabd 100644 --- a/test/unit/app/utils/package-content-hints.spec.ts +++ b/test/unit/app/utils/package-content-hints.spec.ts @@ -37,6 +37,9 @@ describe('isPossiblyUnnecessaryContent', () => { it('flags changelog files', () => { expect(isPossiblyUnnecessaryContent('CHANGELOG.md', 'file')).toBe(true) + expect(isPossiblyUnnecessaryContent('changelog.md', 'file')).toBe(true) + expect(isPossiblyUnnecessaryContent('CHANGELOG.markdown', 'file')).toBe(true) + expect(isPossiblyUnnecessaryContent('changelog.markdown', 'file')).toBe(true) }) it('matches ESLint configuration patterns', () => { @@ -115,6 +118,7 @@ describe('isPossiblyUnnecessaryContent', () => { }) it('flags example directories', () => { + expect(isPossiblyUnnecessaryContent('example', 'directory')).toBe(true) expect(isPossiblyUnnecessaryContent('examples', 'directory')).toBe(true) }) From 88c71cec3477d1004be43d4a7de5b4bad869c9d7 Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 15 Jul 2026 14:36:33 +0100 Subject: [PATCH 4/4] feat: more patterns --- app/utils/package-content-hints.ts | 2 ++ test/unit/app/utils/package-content-hints.spec.ts | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/app/utils/package-content-hints.ts b/app/utils/package-content-hints.ts index 4e6b9bed69..f430ad6adf 100644 --- a/app/utils/package-content-hints.ts +++ b/app/utils/package-content-hints.ts @@ -65,6 +65,8 @@ const POSSIBLY_UNNECESSARY_PATTERNS: readonly RegExp[] = [ /^\.(?!npmrc$)[a-z][a-z0-9_-]*rc$/, /^\.(?!npmrc\.)[a-z][a-z0-9_-]*rc\.(?:json|js|cjs|mjs|yml|yaml|toml)$/, /^\.[a-z][a-z0-9_-]*\.config\.(?:js|cjs|mjs|ts|mts|cts)$/, + // Match files ending in .test.js, .test.ts, .spec.js, .spec.ts, etc. + /(?:test|spec)\.(?:j|t)s$/, ] export function isPossiblyUnnecessaryContent(name: string, type: 'file' | 'directory'): boolean { diff --git a/test/unit/app/utils/package-content-hints.spec.ts b/test/unit/app/utils/package-content-hints.spec.ts index 92b7b0cabd..62ffd818ea 100644 --- a/test/unit/app/utils/package-content-hints.spec.ts +++ b/test/unit/app/utils/package-content-hints.spec.ts @@ -35,6 +35,14 @@ describe('isPossiblyUnnecessaryContent', () => { expect(isPossiblyUnnecessaryContent('.travis.yml', 'file')).toBe(true) }) + it('flags test files', () => { + expect(isPossiblyUnnecessaryContent('test.js', 'file')).toBe(true) + expect(isPossiblyUnnecessaryContent('index.test.js', 'file')).toBe(true) + expect(isPossiblyUnnecessaryContent('index.spec.js', 'file')).toBe(true) + expect(isPossiblyUnnecessaryContent('index.test.ts', 'file')).toBe(true) + expect(isPossiblyUnnecessaryContent('index.spec.ts', 'file')).toBe(true) + }) + it('flags changelog files', () => { expect(isPossiblyUnnecessaryContent('CHANGELOG.md', 'file')).toBe(true) expect(isPossiblyUnnecessaryContent('changelog.md', 'file')).toBe(true)