-
Notifications
You must be signed in to change notification settings - Fork 28.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce unused exports #164935
Comments
Created #165070 for this. The other ones that are listed in search are actually used in some code for the web, so I'll keep them exported. |
|
The lint rule does not seem to be good at identifying things that are transitively used. E.g. if I have something like this type A = foo;
type B = bar;
type C = A | B if type C is used, I want both A and B to be exported so consumers can refer to them if needed (even if no one is doing so at the moment). Anyhow, I'll clean up others... |
@rebornix and I were wondering if there is any dead code in the VS Code codebase, and one idea was to detect unused exports across the codebase, since unused variables are flagged by the compiler but unused exports are not.
I ran
ts-unused-exports
on our sources and generated the following list. I've already done a pass to remove some false positives but apologies if several remain.NB: The primary purpose of this issue is to identify unused functions and classes which aren't being picked up by the compiler because they're exported and which can be safely deleted from our sources to reduce our bundle size. A secondary benefit is to remove unused types and interfaces, e.g. anything which was exported at one point and then ceased to be referenced from other files (which more impacts compile time for dev workflows and pipeline runs, and maybe TS server analysis time, but has no direct impact on bundle size since types are erased).
If you export a type or interface that is not currently actively imported, but is used in the public API of a class that you expose, then it's quite likely that you want to keep that type/interface exported and need not un-export it as part of this issue.
Please feel free to remove your assignment if you find that this isn't valuable.
notebookEditorBackground
IWorkerFileSystemFileHandle
create
LocalFileSearchSimpleWorker
IQuickInputWidgetStyles
IChangeEOLEntry
WalkThroughModel
IObjectTreeViewState
INotebookRendererContribution
MirroredTestCollection
ICustomWebviewViewDescriptor
ISuggestEnabledHistoryOptions
IMemoryRange
IValidMemoryRange
IUnreadableMemoryRange
IErrorMemoryRange
Enablement
BaseBreakpoint
Memory
INotebookRendererContribution
isTenativeCharacterPrediction
PredictionTimeline
terminalsExtPoint
HideTestAction
UnhideTestAction
DebugAction
RunUsingProfileAction
RunAction
SelectDefaultTestProfiles
ConfigureTestProfilesAction
RunSelectedAction
DebugSelectedAction
RunAllAction
DebugAllAction
CancelTestRunAction
TestingViewAsListAction
TestingViewAsTreeAction
TestingSortByStatusAction
TestingSortByLocationAction
TestingSortByDurationAction
ShowMostRecentOutputAction
CollapseAllAction
ClearTestResultsAction
GoToTest
RunAtCursor
DebugAtCursor
RunCurrentFile
DebugCurrentFile
ReRunFailedTests
DebugFailedTests
ReRunLastRun
DebugLastRun
SearchForTestExtension
OpenOutputPeek
ToggleInlineTestOutput
RefreshTestsAction
CancelTestRefreshAction
TestingExplorerViewModel
TestResultElement
TestCaseElement
testingColorIconFailed
testingColorIconErrored
testingColorIconPassed
testingColorIconQueued
testingColorIconUnset
testingColorIconSkipped
ListElementType
testIdentityProvider
pruneNodesWithParentsNotInTree
AutoRunMode
ITestingConfiguration
TestExplorerStateFilter
testStateNames
isDurationAccessor
getComputedState
getComputedDuration
IStoredValueSerialization
ICoverageAccessor
FileCoverage
allTestFilterTerms
ITestItemUpsertChild
ITestItemUpdateCanResolveChildren
ITestItemSetTags
ITestItemRemoveChild
ITestItemSetProp
ITestItemBulkReplace
ITestItemDocumentSynced
ITestItemCollectionOptions
DuplicateTestItemError
MixedTestItemController
ITestRunTaskResults
sumCounts
allChangedResults
isRunningTests
BaseTestResultStorage
TestDiffListener
getCollectionItemParents
getAllTestsInHierarchy
waitForTestToBeIdle
ITestTagDisplayInfo
ITestCoverage
IBranchCoverage
IFunctionCoverage
IStatementCoverage
TreeStateNode
stateNodes
isRunningState
TestObjectTree
UnhideAllTestsAction
The text was updated successfully, but these errors were encountered: