build: enable noUnusedLocals and remove stale unused imports#413
Merged
askpt merged 2 commits intoJun 25, 2026
Merged
Conversation
Add noUnusedLocals: true to tsconfig.json to catch unused local variables at compile time, complementing the existing noImplicitReturns and strict checks. Fix the four pre-existing violations this surfaced in test files: - configuration.test.ts: remove unused CodeMetricsConfig import and simplify the watcher test (drop the never-read changeEventFired flag) - metricsAnalyzerFactory.test.ts: remove unused UnifiedFunctionMetrics import - suite/index.ts: remove unused path import No production source changes; all 149 unit tests continue to pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #413 +/- ##
=======================================
Coverage 78.15% 78.15%
=======================================
Files 13 13
Lines 4161 4161
Branches 469 469
=======================================
Hits 3252 3252
Misses 906 906
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request tightens TypeScript compile-time checks by enabling noUnusedLocals, and updates a few test files to remove unused imports/locals so the project continues to compile cleanly under the stricter setting.
Changes:
- Enabled
compilerOptions.noUnusedLocalsintsconfig.json. - Removed unused imports in test/infrastructure files surfaced by the new compiler option.
- Removed an unused local variable in a configuration watcher test by simplifying the callback to a no-op.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tsconfig.json | Enables noUnusedLocals (and adds the needed comma after noImplicitReturns) to enforce unused-local checks at compile time. |
| src/test/suite/index.ts | Removes an unused path import in the test suite entrypoint. |
| src/test/metricsAnalyzer/metricsAnalyzerFactory.test.ts | Removes an unused type import (UnifiedFunctionMetrics) from the factory tests. |
| src/test/configuration.test.ts | Removes an unused import and eliminates an unused local in the configuration watcher test. |
askpt
approved these changes
Jun 25, 2026
5 tasks
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Enable
noUnusedLocals: trueintsconfig.jsonto catch unused local variables at compile time, and clean up the four pre-existing violations it surfaces in test files.Why
strict: true(already enabled) does not includenoUnusedLocals. Adding it catches a real class of bugs — importing a symbol or declaring a variable and then not using it is almost always a mistake or dead code. The repo already hasnoImplicitReturns(added in #408) andnoFallthroughCasesInSwitch; this is the natural next step.tsconfig.json change
"noImplicitReturns": true, + "noUnusedLocals": true, // "noUnusedParameters": true,Pre-existing violations fixed in test files
configuration.test.tsCodeMetricsConfigimported but never usedconfiguration.test.tschangeEventFireddeclared and set but never readmetricsAnalyzerFactory.test.tsUnifiedFunctionMetricsimported but never usedsuite/index.tspathimported but never usedAll are in test/infrastructure files; no production logic changes.
Test Status
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
releaseassets.githubusercontent.comSee Network Configuration for more information.
Add this agentic workflows to your repo
To install this agentic workflow, run