Repository navigation
build: lint for unused dependencies with knip - #7200
Merged
Merged
Conversation
Pull request dashboard statusMerged · refreshed 2026-10-14 23:08 UTC Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7200 +/- ##
=======================================
Coverage 95.12% 95.12%
=======================================
Files 384 384
Lines 13548 13548
Branches 3128 3128
=======================================
Hits 12888 12888
Misses 660 660 🚀 New features to boost your workflow:
|
trentm
marked this pull request as ready for review
October 14, 2026 23:02
trentm
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
Published packages list dependencies they do not use, and consumers install them for nothing. Nothing in CI checks for this.
Stacked on #7196. The first two commits belong to it.
Short description of the changes
npm run lint:unused-deps, which runsknip --productionwithknip.jsonlimited to dependency issues, and run it as part ofnpm run lint. Private workspaces (examples, e2e and integration tests,packages/template) are ignored, because knip finds no production entry points in them.exporter-metrics-otlp-http: remove@opentelemetry/resources, which nothing insrcortestimports, and its project reference.exporter-zipkin: move@opentelemetry/resourcestodevDependencies, since onlytestimports it.web-common: the unused@opentelemetry/semantic-conventionsis removed in chore(web-common): remove unused semantic-conventions dependency #7196.Unlisted dependencies are left to the build: #7199 fails it on an emitted import of an undeclared package, and #7197 on an inlined one.
Type of change
How Has This Been Tested?
npm run lintpasses, includinglint:unused-deps.lint:unused-depsgives the same result with and withoutdist, so the Lint job does not need a build.@opentelemetry/resourcesback to zipkindependenciesfails it withUnused dependencies (1).exporter-metrics-otlp-httpandexporter-zipkin:npm run compilefrom the root, thenlint,testandtest:browserin each package pass. Zipkindisthas no reference to@opentelemetry/resources.Checklist: