Skip to content

Comments

Add knip for dead code detection, remove unused test utilities#48

Draft
Copilot wants to merge 6 commits intomasterfrom
copilot/validate-unused-configs-cleanup
Draft

Add knip for dead code detection, remove unused test utilities#48
Copilot wants to merge 6 commits intomasterfrom
copilot/validate-unused-configs-cleanup

Conversation

Copy link

Copilot AI commented Jan 27, 2026

Integrated knip to identify unused code, dependencies, and exports. Removed 7 unused test helper functions discovered during initial analysis.

Changes

  • Added knip dependency (5.82.1, exact version) with lint:knip npm script
  • Created knip.json - entry point src/gh-widget-init.ts, ignores demo/dist/test files, excludes sass (peer dep of esbuild-sass-plugin)
  • Removed unused test utilities:
    • setupCacheWithData(), resetCacheMock() from cache-mock.ts
    • createNotModifiedResponse() from fetch-mock.ts
    • createMockRepository(), createMockProfile() from mock-github-data.ts
    • setupTestDOM(), setupCommonTestHooks() from test-utils.ts

Analysis Result

$ npm run lint:knip
✂️ Excellent, Knip found no issues.

No production code modified. All changes isolated to test utilities.

Original prompt

Validate unused configs, code with knip. Apply cleanup.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits January 27, 2026 21:03
Co-authored-by: piotrl <290300+piotrl@users.noreply.github.com>
Co-authored-by: piotrl <290300+piotrl@users.noreply.github.com>
Co-authored-by: piotrl <290300+piotrl@users.noreply.github.com>
Co-authored-by: piotrl <290300+piotrl@users.noreply.github.com>
Co-authored-by: piotrl <290300+piotrl@users.noreply.github.com>
Copilot AI changed the title [WIP] Validate unused configs and cleanup using knip Add knip for dead code detection, remove unused test utilities Jan 27, 2026
Copilot AI requested a review from piotrl January 27, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants