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
Dev-only lint and dependency tooling changes; no runtime or published package behavior.
Overview
Replaces depcheck with knip for dependency linting, aligned with MetaMask core tooling.
.depcheckrc.jsonis removed andknip.config.mtsis added with entriessrc/index.tsandsrc/node.ts, plusignoreDependenciesfor the two Lavamoat packages that are referenced via Yarn/Lavamoat config rather than imports.lint:dependenciesnow runsknip --config knip.config.mts --dependenciesfollowed byyarn dedupe --check(check-only in CI). A newlint:dependencies:fixruns the same knip step with a writableyarn dedupe, andlint:fixpoints at that script instead of the old--checkthreading on depcheck.depcheckand unusedts-nodeare dropped from devDependencies; the lockfile reflects knip’s dependency tree (and prunes depcheck/ts-node-related packages).Reviewed by Cursor Bugbot for commit 9409f44. Bugbot is set up for automated code reviews on this repo. Configure here.