microsoft / microsoft/typespec

Add linter rule or compiler warning for unused imports

Open
#2,196 2 comments 0 reactions 0 assignees View on GitHub
design:needed
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

I have seen many typespec files which import packages they don't actually need, like Azure/azure-rest-api-specs-pr#12933 which was importing `@azure-tools/typespec-providerhub-controller`.

Could we add a linter rule or compiler warnings for imports that are not reference in the typespec (or imports that have no typespec exports)?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.