Skip to content

chore: replace depcheck with knip - #321

Merged
cryptodev-2s merged 3 commits into
chore/align-ci-with-corefrom
chore/replace-depcheck-with-knip
Nov 17, 2026
Merged

cryptodev-2s merged 3 commits into
chore/align-ci-with-corefrom
chore/replace-depcheck-with-knip

Conversation

@cryptodev-2s

@cryptodev-2s cryptodev-2s commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Replaces depcheck with knip like core, keeping the same ignores for dependencies that are used outside of imports, and drops the unused swc cli dependency.


Note

Low Risk
Dev-only lint/tooling swap with no runtime or app logic changes.

Overview
Dependency linting moves from depcheck to knip: lint:dependencies now runs knip --config knip.config.mts --dependencies (still followed by yarn dedupe), and .depcheckrc.json is removed in favor of new knip.config.mts with entry/project globs for src, GitHub scripts/actions, and root config files, plus ignoreDependencies for Lavamoat packages and GitHub Actions-only @actions/* deps (same intent as the old depcheck ignores).

Tooling cleanup: depcheck and unused @swc/cli are dropped from devDependencies; knip is added. knip.config.mts is included in tsconfig.json so it typechecks with the rest of the repo.

Reviewed by Cursor Bugbot for commit 35dd380. Bugbot is set up for automated code reviews on this repo. Configure here.

@cryptodev-2s
cryptodev-2s added this pull request to stack #319 November 12, 2026 12:59
@socket-security

socket-security Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedyaml@​1.10.2 ⏵ 2.9.1100 +1100 +210085100
Addedknip@​6.45.1991009596100

View full report

@socket-security

socket-security Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Priority Alert  (click "▶" to expand/collapse) Action
Low priority
Potential code anomaly (AI signal): npm yaml is 68.0% likely to have a medium risk anomaly

Notes: The code presents a standard, non-malicious NodeBase component used in YAML/JS conversion. The primary risk surface is the optional reviver and onAnchor callbacks provided by the user: if untrusted, these can execute arbitrary code or influence the transformed representation via applyReviver or the reviver itself. This is expected behavior for extensible YAML libraries; ensure callbacks come from trusted sources and sandbox or validate revivers where possible.

Confidence: 0.68

Severity: 0.60

From: package.json → npm/yaml@2.9.1

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

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 support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/yaml@2.9.1. 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.

Warn
Low priority
Environment variable access: npm @emnapi/runtime reads NODE_ENV

Env Vars: NODE_ENV

Location: Package overview

From: package.json → npm/knip@6.45.1 → npm/@emnapi/runtime@1.11.2

ℹ Read more on: This package | This alert | What is environment variable access?

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 support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@emnapi/runtime@1.11.2. 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.

Warn
Low priority
Environment variable access: npm @emnapi/wasi-threads reads NODE_ENV

Env Vars: NODE_ENV

Location: Package overview

From: package.json → npm/knip@6.45.1 → npm/@emnapi/wasi-threads@1.2.2

ℹ Read more on: This package | This alert | What is environment variable access?

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 support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@emnapi/wasi-threads@1.2.2. 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.

Warn
Low priority
Potential code anomaly (AI signal): npm jiti is 68.0% likely to have a medium risk anomaly

Notes: The fragment implements a sophisticated on-the-fly loader using JITI for transpilation and execution, with careful handling of JSON interop based on nearby package.json type. There is no explicit malicious behavior identified (no external network activity, no hardcoded secrets). However, the dynamic code execution path introduced by _wrapSource and the synthetic module environment represents a potential risk vector if untrusted inputs are loaded, or if jiti/mjs execution context could be manipulated. This warrants strict review of the loader environment, the version and security of JITI, and checks on the sources being loaded to mitigate potential code execution or supply chain concerns.

Confidence: 0.68

Severity: 0.60

From: package.json → npm/vite@8.3.8 → npm/knip@6.45.1 → npm/jiti@2.7.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

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 support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/jiti@2.7.0. 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.

Warn
Low priority
Environment variable access: npm jiti

Location: Package overview

From: package.json → npm/vite@8.3.8 → npm/knip@6.45.1 → npm/jiti@2.7.0

ℹ Read more on: This package | This alert | What is environment variable access?

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 support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/jiti@2.7.0. 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.

Warn
Low priority
Environment variable access: npm jiti reads TMPDIR

Env Vars: TMPDIR

Location: Package overview

From: package.json → npm/vite@8.3.8 → npm/knip@6.45.1 → npm/jiti@2.7.0

ℹ Read more on: This package | This alert | What is environment variable access?

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 support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/jiti@2.7.0. 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.

Warn
Low priority
Environment variable access: npm jiti reads JITI_RESPECT_TMPDIR_ENV

Env Vars: JITI_RESPECT_TMPDIR_ENV

Location: Package overview

From: package.json → npm/vite@8.3.8 → npm/knip@6.45.1 → npm/jiti@2.7.0

ℹ Read more on: This package | This alert | What is environment variable access?

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 support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/jiti@2.7.0. 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.

Warn
Low priority
Potential code anomaly (AI signal): npm knip is 97.0% likely to have a medium risk anomaly

Notes: No evidence of malware. The compiler has a code-injection risk: crafted stylesheet import specifiers can escape the generated JavaScript string literal. Exploitability depends on downstream use of the returned code.

Confidence: 0.97

Severity: 0.55

From: package.json → npm/knip@6.45.1

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

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 support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/knip@6.45.1. 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.

Warn
Low priority
Environment variable access: npm package-manager-detector reads npm_config_user_agent

Env Vars: npm_config_user_agent

Location: Package overview

From: package.json → npm/knip@6.45.1 → npm/package-manager-detector@1.9.0

ℹ Read more on: This package | This alert | What is environment variable access?

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 support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/package-manager-detector@1.9.0. 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.

Warn

Ignoring alerts on:

  • formatly@0.11.4
  • oxc-parser@0.156.0
  • oxc-resolver@11.24.2
  • @oxc-resolver/binding-wasm32-wasi@11.24.2
  • @emnapi/core@1.11.2

View full report

@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch from d4714ba to 56de75e Compare November 12, 2026 13:04
@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch from 56de75e to bf0756e Compare November 12, 2026 18:44
@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch 2 times, most recently from 1a34b72 to 7f1f9b3 Compare November 16, 2026 10:11
@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch from 7f1f9b3 to ec62b00 Compare November 16, 2026 10:25
@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch 2 times, most recently from 59ecebe to c9b2269 Compare November 16, 2026 10:49
@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch from c9b2269 to 7eb1df9 Compare November 16, 2026 11:02
@cryptodev-2s
cryptodev-2s removed this pull request from stack #319 November 16, 2026 13:59
@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch from 7eb1df9 to dfda8ed Compare November 16, 2026 14:00
@cryptodev-2s
cryptodev-2s added this pull request to stack #329 November 16, 2026 14:00
@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch from dfda8ed to b12b559 Compare November 16, 2026 14:25
@cryptodev-2s cryptodev-2s self-assigned this Nov 16, 2026
@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch from b12b559 to f13b8ee Compare November 16, 2026 15:10
@cryptodev-2s
cryptodev-2s marked this pull request as ready for review November 16, 2026 16:06
@cryptodev-2s

Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore npm/oxc-parser@0.156.0
@SocketSecurity ignore npm/oxc-resolver@11.24.2
@SocketSecurity ignore npm/formatly@0.11.4
@SocketSecurity ignore npm/@oxc-resolver/binding-wasm32-wasi@11.24.2
@SocketSecurity ignore npm/@emnapi/core@1.11.2

All of these come in through knip, which we already use in other repos. oxc parser and oxc resolver are from the oxc project, and formatly runs a project's formatter, so the shell access is expected. The wasm binding and emnapi are optional fallbacks for wasm32 that don't get installed on macOS or Linux x64.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f13b8ee. Configure here.

Comment thread knip.config.mts Resolved
Comment thread knip.config.mts
// `.github/scripts/remove-rca-needed-label-sheets.ts` runs.
'@actions/core',
'@actions/github',
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Type-aware lint package not ignored

Medium Severity

oxlint-tsgolint was dropped from the ignore list even though oxlint loads it through options.typeAware, not an import. Knip’s oxlint plugin does not trace that setting, so lint:dependencies can report a required lint backend as unused.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f13b8ee. Configure here.

@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch from f13b8ee to 8a93efc Compare November 16, 2026 16:30
Mrtenz
Mrtenz previously approved these changes Nov 16, 2026
@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch 2 times, most recently from 1663658 to 3b3cd84 Compare November 17, 2026 09:07
@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch 2 times, most recently from b64e71c to 19edd5b Compare November 17, 2026 10:09
@cryptodev-2s
cryptodev-2s requested a review from Mrtenz November 17, 2026 10:12
@cryptodev-2s
cryptodev-2s force-pushed the chore/replace-depcheck-with-knip branch from 19edd5b to 35dd380 Compare November 17, 2026 10:27
@cryptodev-2s
cryptodev-2s merged commit 1febe59 into main Nov 17, 2026
21 checks passed
@cryptodev-2s
cryptodev-2s deleted the chore/replace-depcheck-with-knip branch November 17, 2026 12:10
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