Delete unused code in tests#1101
Merged
JasonYeMSFT merged 1 commit intomicrosoft:mainfrom Mar 4, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR cleans up unused test utilities/exports and tightens linting by adding eslint-plugin-import (including a rule to surface unused exports), then removing code that becomes unused as a result.
Changes:
- Add
eslint-plugin-importto the tests ESLint flat config and enableimport/no-unused-modules(unused exports) as a warning. - Remove unused exports/utility functions across
tests/utils/**(e.g., fixture helpers, unused detectors, unused wrapper factories). - Consolidate several duplicate import statements in integration tests.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/trigger-matcher.ts | Removes unused exported types/helpers and minor formatting cleanup. |
| tests/utils/skill-loader.ts | Removes unused exported helpers and narrows exported surface area. |
| tests/utils/regression-detectors.ts | Removes unused detector functions and trims unused imports. |
| tests/utils/git-clone.ts | Makes an internal options type non-exported. |
| tests/utils/fixtures.ts | Deletes unused fixtures utility module. |
| tests/utils/evaluate.ts | Removes an unused exported helper and reformats types. |
| tests/utils/agent-runner.ts | Removes unused exports (deploy link helper + multi-turn conversation runner). |
| tests/package.json | Adds eslint-plugin-import. |
| tests/package-lock.json | Locks new dependency tree for the lint plugin (and updated transitive deps). |
| tests/microsoft-foundry/integration.test.ts | Consolidates imports from evaluate. |
| tests/microsoft-foundry/foundry-agent/create/integration.test.ts | Consolidates imports from evaluate. |
| tests/eslint.config.mjs | Adds eslint-plugin-import flat configs + enables import/no-unused-modules. |
| tests/azure-validate/utils.ts | Removes an unused helper and trims related comment text. |
| tests/azure-validate/integration.test.ts | Consolidates imports from evaluate. |
| tests/azure-resource-visualizer/integration.test.ts | Consolidates imports from evaluate. |
| tests/azure-rbac/integration.test.ts | Consolidates imports from evaluate. |
| tests/azure-prepare/integration.test.ts | Consolidates imports from evaluate. |
| tests/azure-messaging/integration.test.ts | Consolidates imports from evaluate. |
| tests/azure-hosted-copilot-sdk/util.ts | Makes internal helper functions non-exported. |
| tests/.eslintrc | Adds a legacy ESLint config file intended to ignore jest.config.ts. |
Files not reviewed (1)
- tests/package-lock.json: Language not supported
a08b98f to
291e41c
Compare
tmeschter
approved these changes
Mar 4, 2026
Contributor
|
can we have a way to prevent duplicate imports going forward? maybe by enabling |
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 adds a new ESLint plugin with rules to detect duplicate imports and unused exports.
I removed the export operator from the unused exports detected and then removed the unused code revealed.