Skip to content

Conversation

@DerekRoberts
Copy link
Member

@DerekRoberts DerekRoberts commented Jan 13, 2026

This PR removes unused dependencies identified by Knip and adds documentation for reporting false positives upstream.

Changes

Removed Dependencies

Frontend:

  • @faker-js/faker - Not used in codebase
  • @tanstack/react-router-devtools - Not imported or used
  • history - Not used (TanStack Router has its own history implementation)

Backend:

  • source-map-support - Not imported or used
  • ts-loader - Not used (project uses SWC via nest-cli.json)
  • ts-node - Not used in scripts
  • tsconfig-paths - Not used (using NodeNext module resolution)

Documentation Added

Added a new "Dependency Scanning with Knip" section to the README that includes:

  • How to handle unused dependencies
  • Process for reporting false positives upstream to bcgov/action-test-and-analyse
  • Example PR format for upstream repository
  • Common false positive patterns

Configuration

Note: Team-specific knip.config.ts files are not used. All Knip configuration is managed centrally in the upstream bcgov/action-test-and-analyse repository. Teams should report false positives upstream rather than maintaining local config files.

False Positive: @testing-library/user-event

@testing-library/user-event was flagged but is a false positive. It's exported from test-utils.tsx for use in tests but not directly imported yet. This should be reported upstream to bcgov/action-test-and-analyse for addition to .knip.json if needed (see README for process).


Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

@socket-security
Copy link

socket-security bot commented Jan 13, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm entities is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: frontend/package-lock.jsonnpm/[email protected]npm/[email protected]

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes unused dependencies identified by the Knip tool and adds Knip configuration files to document false positives. The changes help reduce bundle size and clarify which dependencies are intentionally kept despite appearing unused.

Changes:

  • Removed 3 unused dependencies from frontend: @faker-js/faker, @tanstack/react-router-devtools, and history
  • Removed 4 unused dependencies from backend: source-map-support, ts-loader, ts-node, and tsconfig-paths
  • Added Knip configuration files to both frontend and backend to document intentionally kept dependencies

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
frontend/package.json Removed three unused dev dependencies that are not imported or used in the codebase
frontend/knip.config.ts Added configuration to whitelist @testing-library/user-event which is exported from test-utils.tsx
backend/package.json Removed four unused dev dependencies related to TypeScript compilation and source mapping
backend/knip.config.ts Added empty configuration file with comment indicating no false positives

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Remove unused frontend dependencies: @faker-js/faker, @tanstack/react-router-devtools, history
- Remove unused backend dependencies: source-map-support, ts-loader, ts-node, tsconfig-paths
- Add documentation for reporting Knip false positives upstream
- Remove team-specific knip.config.ts files (config is managed upstream)
@DerekRoberts DerekRoberts force-pushed the fix/knip-unused-dependencies branch from 8753840 to b8c3861 Compare January 13, 2026 18:04
@DerekRoberts DerekRoberts self-assigned this Jan 13, 2026
@DerekRoberts DerekRoberts requested a review from Copilot January 13, 2026 18:37
@DerekRoberts DerekRoberts changed the title fix: remove unused dependencies and add Knip config fix: remove unused dependencies and add Knip documentation Jan 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DerekRoberts DerekRoberts changed the title fix: remove unused dependencies and add Knip documentation fix: remove unused dependencies Jan 13, 2026
Copy link
Collaborator

@mishraomp mishraomp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@github-project-automation github-project-automation bot moved this from New to Waiting in DevOps (NR) Jan 13, 2026
@DerekRoberts DerekRoberts merged commit f93cb4b into main Jan 13, 2026
27 checks passed
@DerekRoberts DerekRoberts deleted the fix/knip-unused-dependencies branch January 13, 2026 19:33
@github-project-automation github-project-automation bot moved this from Waiting to Done in DevOps (NR) Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants