Core dropped depcheck for knip, so match it.
depcheck ^1.4.7 removed, along with .depcheckrc.json
knip ^6.23.0 added, with knip.config.mts
Scripts follow core's shape: lint:dependencies bakes in `yarn dedupe --check`
and a separate lint:dependencies:fix runs the writing form, rather than
passing --check through from `lint`.
The config is nine lines rather than core's 292, because that file is almost
entirely per workspace tuning for a monorepo and this is a single package.
Only the two lavamoat packages need ignoring: both are wired in through the
Yarn plugin and the lavamoat.allowScripts field rather than imported, so knip
cannot see the usage.
Switching also turned up dead weight that depcheck had been hiding. Its
ignore list included ts-node, which nothing references: it is not a peer of
ts-jest, appears nowhere outside its own package.json entry, and core does
not carry it. Removed rather than re-ignored.
knip requires Node ^20.19.0 || >=22.12.0. Only the Lint job runs it, and that
job is pinned to 22.x, so this is safe ahead of the Node floor bump.
Core dropped
depcheckforknip, so match it. Sits below the Node bump so it lands with the rest of the tooling alignment.depcheck@^1.4.7+.depcheckrc.jsonknip@^6.23.0+knip.config.mtsScripts follow core's shape:
lint:dependenciesbakes inyarn dedupe --check, with a separatelint:dependencies:fixfor the writing form, rather than threading--checkthrough fromlint.Config is nine lines, not core's 292
Core's
knip.config.mtsis almost entirely per-workspace tuning for a monorepo. This is a single package, so it needs an entry pair and two ignores:Both lavamoat packages are wired in through the Yarn plugin and the
lavamoat.allowScriptsfield rather than imported, so knip can't see the usage.It found dead weight depcheck was hiding
The old
.depcheckrc.jsonignore list includedts-node. Nothing references it: it isn't a peer ofts-jest, appears nowhere outside its ownpackage.jsonentry, and core doesn't carry it. Removed rather than re-ignored.Node requirement
knip needs
^20.19.0 || >=22.12.0. Only the Lint job runs it and that job is pinned to22.x, so this is safe ahead of the Node floor bump in the next PR.Note
Low Risk
Tooling-only changes to lint scripts and devDependencies; no runtime library code paths are modified.
Overview
Replaces depcheck with knip for dependency linting, aligned with MetaMask core: removes
.depcheckrc.json, adds a smallknip.config.mts(entriessrc/index.ts/src/node.ts, Lavamoat packages inignoreDependencies), and wireslint:dependenciestoknip --dependenciesplusyarn dedupe --check, withlint:dependencies:fixfor the mutating dedupe path used bylint:fix.Also drops the unused
ts-nodedevDependency (previously only on depcheck’s ignore list) and refreshesyarn.lockfor knip and its transitive tree while pruning depcheck-related packages.Reviewed by Cursor Bugbot for commit c6ce5d5. Bugbot is set up for automated code reviews on this repo. Configure here.