diff --git a/scripts/applyPatchForInsiders.js b/scripts/applyPatchForInsiders.js index 333cd87..f5954a2 100644 --- a/scripts/applyPatchForInsiders.js +++ b/scripts/applyPatchForInsiders.js @@ -1,6 +1,5 @@ /* eslint-disable import/order */ /* eslint-disable @typescript-eslint/no-var-requires */ -'use strict'; const fs = require('fs'); // Patch README diff --git a/src/annotations/annotationProvider.ts b/src/annotations/annotationProvider.ts index 159a8fe..cdf4caa 100644 --- a/src/annotations/annotationProvider.ts +++ b/src/annotations/annotationProvider.ts @@ -1,4 +1,3 @@ -'use strict'; import { DecorationOptions, Disposable, diff --git a/src/annotations/annotations.ts b/src/annotations/annotations.ts index c05ab4d..63b46a3 100644 --- a/src/annotations/annotations.ts +++ b/src/annotations/annotations.ts @@ -1,4 +1,3 @@ -'use strict'; import { DecorationInstanceRenderOptions, DecorationOptions, diff --git a/src/annotations/autolinks.ts b/src/annotations/autolinks.ts index cb91445..ac245e7 100644 --- a/src/annotations/autolinks.ts +++ b/src/annotations/autolinks.ts @@ -1,4 +1,3 @@ -'use strict'; import { ConfigurationChangeEvent, Disposable } from 'vscode'; import { AutolinkReference, configuration } from '../configuration'; import { GlyphChars } from '../constants'; diff --git a/src/annotations/blameAnnotationProvider.ts b/src/annotations/blameAnnotationProvider.ts index 7598858..eb70073 100644 --- a/src/annotations/blameAnnotationProvider.ts +++ b/src/annotations/blameAnnotationProvider.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, Disposable, Hover, languages, Position, Range, TextDocument, TextEditor } from 'vscode'; import { FileAnnotationType } from '../config'; import { Container } from '../container'; diff --git a/src/annotations/fileAnnotationController.ts b/src/annotations/fileAnnotationController.ts index fecbea7..52cda9a 100644 --- a/src/annotations/fileAnnotationController.ts +++ b/src/annotations/fileAnnotationController.ts @@ -1,4 +1,3 @@ -'use strict'; import { ConfigurationChangeEvent, DecorationRangeBehavior, diff --git a/src/annotations/gutterBlameAnnotationProvider.ts b/src/annotations/gutterBlameAnnotationProvider.ts index 3b862fa..e0c2146 100644 --- a/src/annotations/gutterBlameAnnotationProvider.ts +++ b/src/annotations/gutterBlameAnnotationProvider.ts @@ -1,4 +1,3 @@ -'use strict'; import { DecorationOptions, Range, TextEditor, ThemableDecorationAttachmentRenderOptions } from 'vscode'; import { FileAnnotationType, GravatarDefaultStyle } from '../configuration'; import { GlyphChars } from '../constants'; diff --git a/src/annotations/gutterChangesAnnotationProvider.ts b/src/annotations/gutterChangesAnnotationProvider.ts index fb0995c..220d568 100644 --- a/src/annotations/gutterChangesAnnotationProvider.ts +++ b/src/annotations/gutterChangesAnnotationProvider.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, DecorationOptions, diff --git a/src/annotations/gutterHeatmapBlameAnnotationProvider.ts b/src/annotations/gutterHeatmapBlameAnnotationProvider.ts index 10848dc..838a187 100644 --- a/src/annotations/gutterHeatmapBlameAnnotationProvider.ts +++ b/src/annotations/gutterHeatmapBlameAnnotationProvider.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, TextEditor, TextEditorDecorationType } from 'vscode'; import { FileAnnotationType } from '../configuration'; import { Container } from '../container'; diff --git a/src/annotations/lineAnnotationController.ts b/src/annotations/lineAnnotationController.ts index 9b8ee88..4dec000 100644 --- a/src/annotations/lineAnnotationController.ts +++ b/src/annotations/lineAnnotationController.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, CancellationTokenSource, diff --git a/src/api/actionRunners.ts b/src/api/actionRunners.ts index 714b243..cfe1542 100644 --- a/src/api/actionRunners.ts +++ b/src/api/actionRunners.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, Disposable, Event, EventEmitter, QuickPickItem, window } from 'vscode'; import { Commands } from '../commands/common'; import { Config, configuration } from '../configuration'; diff --git a/src/api/api.ts b/src/api/api.ts index dcc7c82..c38ffe5 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable } from 'vscode'; import { Container } from '../container'; import { Logger } from '../logger'; diff --git a/src/api/gitlens.d.ts b/src/api/gitlens.d.ts index 85d6cbc..6a4349d 100644 --- a/src/api/gitlens.d.ts +++ b/src/api/gitlens.d.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable } from 'vscode'; export { Disposable } from 'vscode'; diff --git a/src/avatars.ts b/src/avatars.ts index 7789455..1dda4f1 100644 --- a/src/avatars.ts +++ b/src/avatars.ts @@ -1,4 +1,3 @@ -'use strict'; import { EventEmitter, Uri } from 'vscode'; import { GravatarDefaultStyle } from './config'; import { GlobalState } from './constants'; diff --git a/src/codelens/codeLensController.ts b/src/codelens/codeLensController.ts index 72abfdc..104bd4d 100644 --- a/src/codelens/codeLensController.ts +++ b/src/codelens/codeLensController.ts @@ -1,4 +1,3 @@ -'use strict'; import { ConfigurationChangeEvent, Disposable, languages } from 'vscode'; import { configuration } from '../configuration'; import { ContextKeys, setContext } from '../constants'; diff --git a/src/codelens/codeLensProvider.ts b/src/codelens/codeLensProvider.ts index 0417496..b7fa1e9 100644 --- a/src/codelens/codeLensProvider.ts +++ b/src/codelens/codeLensProvider.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, CodeLens, diff --git a/src/commands.ts b/src/commands.ts index 6eae144..ec96f21 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -1,4 +1,3 @@ -'use strict'; import { Command } from 'vscode'; export function command(command: Omit & { arguments: [...T] }): Command { diff --git a/src/commands/addAuthors.ts b/src/commands/addAuthors.ts index 40c84b0..598ab46 100644 --- a/src/commands/addAuthors.ts +++ b/src/commands/addAuthors.ts @@ -1,4 +1,3 @@ -'use strict'; import { SourceControl } from 'vscode'; import type { Container } from '../container'; import { command, Command, Commands } from './common'; diff --git a/src/commands/browseRepoAtRevision.ts b/src/commands/browseRepoAtRevision.ts index e6811eb..175d483 100644 --- a/src/commands/browseRepoAtRevision.ts +++ b/src/commands/browseRepoAtRevision.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, TextEditor, Uri } from 'vscode'; import { BuiltInCommands } from '../constants'; import type { Container } from '../container'; diff --git a/src/commands/closeUnchangedFiles.ts b/src/commands/closeUnchangedFiles.ts index 362a2f6..675630d 100644 --- a/src/commands/closeUnchangedFiles.ts +++ b/src/commands/closeUnchangedFiles.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, TextEditor, Uri, window } from 'vscode'; import { TextEditorComparer, UriComparer } from '../comparers'; import { BuiltInCommands } from '../constants'; diff --git a/src/commands/closeView.ts b/src/commands/closeView.ts index 61db612..093b2e8 100644 --- a/src/commands/closeView.ts +++ b/src/commands/closeView.ts @@ -1,4 +1,3 @@ -'use strict'; import { ContextKeys, setContext, SyncedState } from '../constants'; import type { Container } from '../container'; import { command, Command, CommandContext, Commands } from './common'; diff --git a/src/commands/common.ts b/src/commands/common.ts index 7737206..00fde43 100644 --- a/src/commands/common.ts +++ b/src/commands/common.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, Disposable, diff --git a/src/commands/compareWith.ts b/src/commands/compareWith.ts index 714d0d6..606f096 100644 --- a/src/commands/compareWith.ts +++ b/src/commands/compareWith.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri } from 'vscode'; import type { Container } from '../container'; import { Logger } from '../logger'; diff --git a/src/commands/copyCurrentBranch.ts b/src/commands/copyCurrentBranch.ts index 6283f5d..5db71b9 100644 --- a/src/commands/copyCurrentBranch.ts +++ b/src/commands/copyCurrentBranch.ts @@ -1,4 +1,3 @@ -'use strict'; import { env, TextEditor, Uri, window } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/copyMessageToClipboard.ts b/src/commands/copyMessageToClipboard.ts index 096140f..9ac305e 100644 --- a/src/commands/copyMessageToClipboard.ts +++ b/src/commands/copyMessageToClipboard.ts @@ -1,4 +1,3 @@ -'use strict'; import { env, TextEditor, Uri } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/copyShaToClipboard.ts b/src/commands/copyShaToClipboard.ts index 69eea75..946d2de 100644 --- a/src/commands/copyShaToClipboard.ts +++ b/src/commands/copyShaToClipboard.ts @@ -1,4 +1,3 @@ -'use strict'; import { env, TextEditor, Uri } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/createPullRequestOnRemote.ts b/src/commands/createPullRequestOnRemote.ts index 8a2c6bf..fa3b80d 100644 --- a/src/commands/createPullRequestOnRemote.ts +++ b/src/commands/createPullRequestOnRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import type { Container } from '../container'; import { GitRemote } from '../git/models'; import { RemoteProvider, RemoteResource, RemoteResourceType } from '../git/remotes/provider'; diff --git a/src/commands/diffLineWithPrevious.ts b/src/commands/diffLineWithPrevious.ts index d13d07d..df5343a 100644 --- a/src/commands/diffLineWithPrevious.ts +++ b/src/commands/diffLineWithPrevious.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextDocumentShowOptions, TextEditor, Uri } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/diffLineWithWorking.ts b/src/commands/diffLineWithWorking.ts index 1535071..0758999 100644 --- a/src/commands/diffLineWithWorking.ts +++ b/src/commands/diffLineWithWorking.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/diffWith.ts b/src/commands/diffWith.ts index 56af5fc..d565d11 100644 --- a/src/commands/diffWith.ts +++ b/src/commands/diffWith.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, Range, TextDocumentShowOptions, Uri, ViewColumn } from 'vscode'; import { BuiltInCommands, GlyphChars } from '../constants'; import type { Container } from '../container'; diff --git a/src/commands/diffWithNext.ts b/src/commands/diffWithNext.ts index f045f59..4a736d1 100644 --- a/src/commands/diffWithNext.ts +++ b/src/commands/diffWithNext.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, TextDocumentShowOptions, TextEditor, Uri } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/diffWithPrevious.ts b/src/commands/diffWithPrevious.ts index 12d5020..49f140e 100644 --- a/src/commands/diffWithPrevious.ts +++ b/src/commands/diffWithPrevious.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextDocumentShowOptions, TextEditor, Uri } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/diffWithRevision.ts b/src/commands/diffWithRevision.ts index c7c5429..388cc93 100644 --- a/src/commands/diffWithRevision.ts +++ b/src/commands/diffWithRevision.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextDocumentShowOptions, TextEditor, Uri } from 'vscode'; import { GlyphChars, quickPickTitleMaxChars } from '../constants'; import type { Container } from '../container'; diff --git a/src/commands/diffWithRevisionFrom.ts b/src/commands/diffWithRevisionFrom.ts index 0e7090f..00c9350 100644 --- a/src/commands/diffWithRevisionFrom.ts +++ b/src/commands/diffWithRevisionFrom.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextDocumentShowOptions, TextEditor, Uri } from 'vscode'; import { GlyphChars, quickPickTitleMaxChars } from '../constants'; import type { Container } from '../container'; diff --git a/src/commands/diffWithWorking.ts b/src/commands/diffWithWorking.ts index 712bf93..7e7997a 100644 --- a/src/commands/diffWithWorking.ts +++ b/src/commands/diffWithWorking.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/externalDiff.ts b/src/commands/externalDiff.ts index b2444c5..66eaef5 100644 --- a/src/commands/externalDiff.ts +++ b/src/commands/externalDiff.ts @@ -1,4 +1,3 @@ -'use strict'; import { env, SourceControlResourceState, Uri, window } from 'vscode'; import { ScmResource } from '../@types/vscode.git.resources'; import { ScmResourceGroupType, ScmStatus } from '../@types/vscode.git.resources.enums'; diff --git a/src/commands/git/branch.ts b/src/commands/git/branch.ts index 43cefe7..6e364dc 100644 --- a/src/commands/git/branch.ts +++ b/src/commands/git/branch.ts @@ -1,4 +1,3 @@ -'use strict'; import { QuickInputButtons } from 'vscode'; import { Container } from '../../container'; import { GitBranchReference, GitReference, Repository } from '../../git/models'; diff --git a/src/commands/git/cherry-pick.ts b/src/commands/git/cherry-pick.ts index 18b9273..3959501 100644 --- a/src/commands/git/cherry-pick.ts +++ b/src/commands/git/cherry-pick.ts @@ -1,4 +1,3 @@ -'use strict'; import { Container } from '../../container'; import { GitBranch, GitLog, GitReference, GitRevision, Repository } from '../../git/models'; import { FlagsQuickPickItem } from '../../quickpicks'; diff --git a/src/commands/git/coauthors.ts b/src/commands/git/coauthors.ts index 77a08c8..3636fd5 100644 --- a/src/commands/git/coauthors.ts +++ b/src/commands/git/coauthors.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands } from 'vscode'; import { Container } from '../../container'; import { GitContributor, Repository } from '../../git/models'; diff --git a/src/commands/git/fetch.ts b/src/commands/git/fetch.ts index 039b703..396a372 100644 --- a/src/commands/git/fetch.ts +++ b/src/commands/git/fetch.ts @@ -1,4 +1,3 @@ -'use strict'; import { GlyphChars } from '../../constants'; import { Container } from '../../container'; import { GitBranchReference, GitReference, Repository } from '../../git/models'; diff --git a/src/commands/git/log.ts b/src/commands/git/log.ts index 12790fb..865363b 100644 --- a/src/commands/git/log.ts +++ b/src/commands/git/log.ts @@ -1,4 +1,3 @@ -'use strict'; import { GlyphChars, quickPickTitleMaxChars } from '../../constants'; import { Container } from '../../container'; import { GitUri } from '../../git/gitUri'; diff --git a/src/commands/git/merge.ts b/src/commands/git/merge.ts index f1042a8..3079016 100644 --- a/src/commands/git/merge.ts +++ b/src/commands/git/merge.ts @@ -1,4 +1,3 @@ -'use strict'; import { Container } from '../../container'; import { GitBranch, GitLog, GitReference, GitRevision, Repository } from '../../git/models'; import { Directive, DirectiveQuickPickItem, FlagsQuickPickItem } from '../../quickpicks'; diff --git a/src/commands/git/pull.ts b/src/commands/git/pull.ts index 139cd83..909a4e0 100644 --- a/src/commands/git/pull.ts +++ b/src/commands/git/pull.ts @@ -1,4 +1,3 @@ -'use strict'; import { GlyphChars } from '../../constants'; import { Container } from '../../container'; import { GitBranch, GitBranchReference, GitReference, Repository } from '../../git/models'; diff --git a/src/commands/git/push.ts b/src/commands/git/push.ts index 49cd404..910f948 100644 --- a/src/commands/git/push.ts +++ b/src/commands/git/push.ts @@ -1,4 +1,3 @@ -'use strict'; import { configuration } from '../../configuration'; import { BuiltInGitConfiguration, GlyphChars } from '../../constants'; import { Container } from '../../container'; diff --git a/src/commands/git/rebase.ts b/src/commands/git/rebase.ts index 96bbdb6..68c2ff9 100644 --- a/src/commands/git/rebase.ts +++ b/src/commands/git/rebase.ts @@ -1,4 +1,3 @@ -'use strict'; import { env } from 'vscode'; import { Container } from '../../container'; import { GitBranch, GitLog, GitReference, GitRevision, Repository } from '../../git/models'; diff --git a/src/commands/git/reset.ts b/src/commands/git/reset.ts index 40f3403..cbb0457 100644 --- a/src/commands/git/reset.ts +++ b/src/commands/git/reset.ts @@ -1,4 +1,3 @@ -'use strict'; import { Container } from '../../container'; import { GitBranch, GitLog, GitReference, GitRevisionReference, Repository } from '../../git/models'; import { FlagsQuickPickItem } from '../../quickpicks'; diff --git a/src/commands/git/revert.ts b/src/commands/git/revert.ts index a82ee6d..0138ff4 100644 --- a/src/commands/git/revert.ts +++ b/src/commands/git/revert.ts @@ -1,4 +1,3 @@ -'use strict'; import { Container } from '../../container'; import { GitBranch, GitLog, GitReference, GitRevisionReference, Repository } from '../../git/models'; import { FlagsQuickPickItem } from '../../quickpicks'; diff --git a/src/commands/git/search.ts b/src/commands/git/search.ts index 0e42de0..8c7c686 100644 --- a/src/commands/git/search.ts +++ b/src/commands/git/search.ts @@ -1,4 +1,3 @@ -'use strict'; import { GlyphChars } from '../../constants'; import { Container } from '../../container'; import { GitLog, GitLogCommit, Repository } from '../../git/models'; diff --git a/src/commands/git/show.ts b/src/commands/git/show.ts index f841ff9..8a67c69 100644 --- a/src/commands/git/show.ts +++ b/src/commands/git/show.ts @@ -1,4 +1,3 @@ -'use strict'; import { Container } from '../../container'; import { GitAuthor, GitLogCommit, GitRevisionReference, GitStashCommit, Repository } from '../../git/models'; import { CommandQuickPickItem, CommitFilesQuickPickItem, GitCommandQuickPickItem } from '../../quickpicks'; diff --git a/src/commands/git/stash.ts b/src/commands/git/stash.ts index 64b964d..16d9d38 100644 --- a/src/commands/git/stash.ts +++ b/src/commands/git/stash.ts @@ -1,4 +1,3 @@ -'use strict'; import { QuickInputButtons, QuickPickItem, Uri, window } from 'vscode'; import { GlyphChars } from '../../constants'; import { Container } from '../../container'; diff --git a/src/commands/git/status.ts b/src/commands/git/status.ts index 7a317b6..9c0fb68 100644 --- a/src/commands/git/status.ts +++ b/src/commands/git/status.ts @@ -1,4 +1,3 @@ -'use strict'; import { GlyphChars } from '../../constants'; import { Container } from '../../container'; import { GitReference, GitStatus, Repository } from '../../git/models'; diff --git a/src/commands/git/switch.ts b/src/commands/git/switch.ts index 43a53be..e18fc1e 100644 --- a/src/commands/git/switch.ts +++ b/src/commands/git/switch.ts @@ -1,4 +1,3 @@ -'use strict'; import { ProgressLocation, QuickPickItem, window } from 'vscode'; import { BranchSorting } from '../../config'; import { Container } from '../../container'; diff --git a/src/commands/git/tag.ts b/src/commands/git/tag.ts index 871861f..9e31f46 100644 --- a/src/commands/git/tag.ts +++ b/src/commands/git/tag.ts @@ -1,4 +1,3 @@ -'use strict'; import { QuickInputButtons, QuickPickItem } from 'vscode'; import { Container } from '../../container'; import { GitReference, GitTagReference, Repository } from '../../git/models'; diff --git a/src/commands/gitCommands.ts b/src/commands/gitCommands.ts index be20ac3..30849a2 100644 --- a/src/commands/gitCommands.ts +++ b/src/commands/gitCommands.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, InputBox, QuickInputButton, QuickInputButtons, QuickPick, QuickPickItem, window } from 'vscode'; import { configuration, GitCommandSorting } from '../configuration'; import { Usage, WorkspaceState } from '../constants'; diff --git a/src/commands/inviteToLiveShare.ts b/src/commands/inviteToLiveShare.ts index 674a357..c5a2760 100644 --- a/src/commands/inviteToLiveShare.ts +++ b/src/commands/inviteToLiveShare.ts @@ -1,4 +1,3 @@ -'use strict'; import type { Container } from '../container'; import { command, Command, CommandContext, Commands, isCommandContextViewNodeHasContributor } from './common'; diff --git a/src/commands/logging.ts b/src/commands/logging.ts index 211f7ae..9ca28ff 100644 --- a/src/commands/logging.ts +++ b/src/commands/logging.ts @@ -1,4 +1,3 @@ -'use strict'; import { configuration, OutputLevel } from '../configuration'; import type { Container } from '../container'; import { command, Command, Commands } from './common'; diff --git a/src/commands/openAssociatedPullRequestOnRemote.ts b/src/commands/openAssociatedPullRequestOnRemote.ts index 2550a36..726eeea 100644 --- a/src/commands/openAssociatedPullRequestOnRemote.ts +++ b/src/commands/openAssociatedPullRequestOnRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/openBranchOnRemote.ts b/src/commands/openBranchOnRemote.ts index a32b592..3b619ec 100644 --- a/src/commands/openBranchOnRemote.ts +++ b/src/commands/openBranchOnRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri, window } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/openBranchesOnRemote.ts b/src/commands/openBranchesOnRemote.ts index 3739b91..f7c14fa 100644 --- a/src/commands/openBranchesOnRemote.ts +++ b/src/commands/openBranchesOnRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri, window } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/openChangedFiles.ts b/src/commands/openChangedFiles.ts index 27f4fd5..9e184ab 100644 --- a/src/commands/openChangedFiles.ts +++ b/src/commands/openChangedFiles.ts @@ -1,4 +1,3 @@ -'use strict'; import { Uri, window } from 'vscode'; import type { Container } from '../container'; import { Logger } from '../logger'; diff --git a/src/commands/openCommitOnRemote.ts b/src/commands/openCommitOnRemote.ts index 0d862ce..f81e84d 100644 --- a/src/commands/openCommitOnRemote.ts +++ b/src/commands/openCommitOnRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri, window } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/openComparisonOnRemote.ts b/src/commands/openComparisonOnRemote.ts index b81d094..6249ecf 100644 --- a/src/commands/openComparisonOnRemote.ts +++ b/src/commands/openComparisonOnRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import { window } from 'vscode'; import type { Container } from '../container'; import { RemoteResourceType } from '../git/remotes/provider'; diff --git a/src/commands/openDirectoryCompare.ts b/src/commands/openDirectoryCompare.ts index 509aff4..cc35bb1 100644 --- a/src/commands/openDirectoryCompare.ts +++ b/src/commands/openDirectoryCompare.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri } from 'vscode'; import { GitActions } from '../commands'; import type { Container } from '../container'; diff --git a/src/commands/openFileAtRevision.ts b/src/commands/openFileAtRevision.ts index 6bff0c1..28133eb 100644 --- a/src/commands/openFileAtRevision.ts +++ b/src/commands/openFileAtRevision.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextDocumentShowOptions, TextEditor, Uri } from 'vscode'; import { FileAnnotationType } from '../configuration'; import { GlyphChars, quickPickTitleMaxChars } from '../constants'; diff --git a/src/commands/openFileAtRevisionFrom.ts b/src/commands/openFileAtRevisionFrom.ts index 95c2683..a80177e 100644 --- a/src/commands/openFileAtRevisionFrom.ts +++ b/src/commands/openFileAtRevisionFrom.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextDocumentShowOptions, TextEditor, Uri } from 'vscode'; import { FileAnnotationType } from '../configuration'; import { GlyphChars, quickPickTitleMaxChars } from '../constants'; diff --git a/src/commands/openFileFromRemote.ts b/src/commands/openFileFromRemote.ts index 4994986..d7f4699 100644 --- a/src/commands/openFileFromRemote.ts +++ b/src/commands/openFileFromRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import { env, Range, Uri, window } from 'vscode'; import type { Container } from '../container'; import { command, Command, Commands, openEditor } from './common'; diff --git a/src/commands/openFileOnRemote.ts b/src/commands/openFileOnRemote.ts index fe59da9..757be66 100644 --- a/src/commands/openFileOnRemote.ts +++ b/src/commands/openFileOnRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, TextEditor, Uri, window } from 'vscode'; import { UriComparer } from '../comparers'; import { BranchSorting, TagSorting } from '../configuration'; diff --git a/src/commands/openIssueOnRemote.ts b/src/commands/openIssueOnRemote.ts index 4edc3ab..47bcbd5 100644 --- a/src/commands/openIssueOnRemote.ts +++ b/src/commands/openIssueOnRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import { env, Uri } from 'vscode'; import type { Container } from '../container'; import { AutolinkedItemNode } from '../views/nodes/autolinkedItemNode'; diff --git a/src/commands/openOnRemote.ts b/src/commands/openOnRemote.ts index a31bcff..aa57888 100644 --- a/src/commands/openOnRemote.ts +++ b/src/commands/openOnRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import { GlyphChars } from '../constants'; import type { Container } from '../container'; import { GitRemote, GitRevision } from '../git/models'; diff --git a/src/commands/openPullRequestOnRemote.ts b/src/commands/openPullRequestOnRemote.ts index b03ae7f..1be167d 100644 --- a/src/commands/openPullRequestOnRemote.ts +++ b/src/commands/openPullRequestOnRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import { env, Uri } from 'vscode'; import type { Container } from '../container'; import { PullRequestNode } from '../views/nodes'; diff --git a/src/commands/openRepoOnRemote.ts b/src/commands/openRepoOnRemote.ts index fa5052b..88ba568 100644 --- a/src/commands/openRepoOnRemote.ts +++ b/src/commands/openRepoOnRemote.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri, window } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/openRevisionFile.ts b/src/commands/openRevisionFile.ts index ad2334a..b51f970 100644 --- a/src/commands/openRevisionFile.ts +++ b/src/commands/openRevisionFile.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextDocumentShowOptions, TextEditor, Uri } from 'vscode'; import { FileAnnotationType } from '../configuration'; import type { Container } from '../container'; diff --git a/src/commands/openWorkingFile.ts b/src/commands/openWorkingFile.ts index b671446..623bf2d 100644 --- a/src/commands/openWorkingFile.ts +++ b/src/commands/openWorkingFile.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; import { FileAnnotationType } from '../configuration'; import type { Container } from '../container'; diff --git a/src/commands/quickCommand.buttons.ts b/src/commands/quickCommand.buttons.ts index 04fb0b5..9f90b36 100644 --- a/src/commands/quickCommand.buttons.ts +++ b/src/commands/quickCommand.buttons.ts @@ -1,4 +1,3 @@ -'use strict'; import { QuickInput, QuickInputButton, ThemeIcon, Uri } from 'vscode'; import { Container } from '../container'; diff --git a/src/commands/quickCommand.steps.ts b/src/commands/quickCommand.steps.ts index ca89ee5..0302ee1 100644 --- a/src/commands/quickCommand.steps.ts +++ b/src/commands/quickCommand.steps.ts @@ -1,4 +1,3 @@ -'use strict'; import { QuickInputButton, QuickPick } from 'vscode'; import { BranchSorting, configuration, TagSorting } from '../configuration'; import { GlyphChars, quickPickTitleMaxChars } from '../constants'; diff --git a/src/commands/quickCommand.ts b/src/commands/quickCommand.ts index 1cb0aae..90b8b99 100644 --- a/src/commands/quickCommand.ts +++ b/src/commands/quickCommand.ts @@ -1,4 +1,3 @@ -'use strict'; import { InputBox, QuickInputButton, QuickPick, QuickPickItem } from 'vscode'; import type { Container } from '../container'; import { Keys } from '../keyboard'; diff --git a/src/commands/rebaseEditor.ts b/src/commands/rebaseEditor.ts index 19e4694..7ad0894 100644 --- a/src/commands/rebaseEditor.ts +++ b/src/commands/rebaseEditor.ts @@ -1,4 +1,3 @@ -'use strict'; import type { Container } from '../container'; import { command, Command, Commands } from './common'; diff --git a/src/commands/refreshHover.ts b/src/commands/refreshHover.ts index 7b485f6..cb2988e 100644 --- a/src/commands/refreshHover.ts +++ b/src/commands/refreshHover.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands } from 'vscode'; import type { Container } from '../container'; import { command, Command, Commands } from './common'; diff --git a/src/commands/remoteProviders.ts b/src/commands/remoteProviders.ts index 6b6c9c5..f3c114e 100644 --- a/src/commands/remoteProviders.ts +++ b/src/commands/remoteProviders.ts @@ -1,4 +1,3 @@ -'use strict'; import type { Container } from '../container'; import { GitCommit, GitRemote, Repository } from '../git/models'; import { RichRemoteProvider } from '../git/remotes/provider'; diff --git a/src/commands/repositories.ts b/src/commands/repositories.ts index 84079a0..e5fe125 100644 --- a/src/commands/repositories.ts +++ b/src/commands/repositories.ts @@ -1,4 +1,3 @@ -'use strict'; import { executeGitCommand } from '../commands'; import type { Container } from '../container'; import { command, Command, Commands } from './common'; diff --git a/src/commands/resetAvatarCache.ts b/src/commands/resetAvatarCache.ts index a778fc9..e7e3d15 100644 --- a/src/commands/resetAvatarCache.ts +++ b/src/commands/resetAvatarCache.ts @@ -1,4 +1,3 @@ -'use strict'; import { resetAvatarCache } from '../avatars'; import type { Container } from '../container'; import { command, Command, Commands } from './common'; diff --git a/src/commands/resetSuppressedWarnings.ts b/src/commands/resetSuppressedWarnings.ts index f903f62..07e0992 100644 --- a/src/commands/resetSuppressedWarnings.ts +++ b/src/commands/resetSuppressedWarnings.ts @@ -1,4 +1,3 @@ -'use strict'; import { ConfigurationTarget } from 'vscode'; import { configuration } from '../configuration'; import type { Container } from '../container'; diff --git a/src/commands/searchCommits.ts b/src/commands/searchCommits.ts index 3be5e92..b7d543c 100644 --- a/src/commands/searchCommits.ts +++ b/src/commands/searchCommits.ts @@ -1,4 +1,3 @@ -'use strict'; import { executeGitCommand } from '../commands'; import type { Container } from '../container'; import { SearchPattern } from '../git/search'; diff --git a/src/commands/setViewsLayout.ts b/src/commands/setViewsLayout.ts index 5fd9ee0..cb5979e 100644 --- a/src/commands/setViewsLayout.ts +++ b/src/commands/setViewsLayout.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, window } from 'vscode'; import { viewsConfigKeys } from '../configuration'; import type { Container } from '../container'; diff --git a/src/commands/showCommitsInView.ts b/src/commands/showCommitsInView.ts index 10c0251..dbae226 100644 --- a/src/commands/showCommitsInView.ts +++ b/src/commands/showCommitsInView.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri } from 'vscode'; import { executeGitCommand } from '../commands'; import type { Container } from '../container'; diff --git a/src/commands/showLastQuickPick.ts b/src/commands/showLastQuickPick.ts index 56901bd..a5fb3d3 100644 --- a/src/commands/showLastQuickPick.ts +++ b/src/commands/showLastQuickPick.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands } from 'vscode'; import type { Container } from '../container'; import { Logger } from '../logger'; diff --git a/src/commands/showQuickBranchHistory.ts b/src/commands/showQuickBranchHistory.ts index 064c8dc..f1228ba 100644 --- a/src/commands/showQuickBranchHistory.ts +++ b/src/commands/showQuickBranchHistory.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/showQuickCommit.ts b/src/commands/showQuickCommit.ts index c2765fc..eb63992 100644 --- a/src/commands/showQuickCommit.ts +++ b/src/commands/showQuickCommit.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/showQuickCommitFile.ts b/src/commands/showQuickCommitFile.ts index a2a915a..a3cbddb 100644 --- a/src/commands/showQuickCommitFile.ts +++ b/src/commands/showQuickCommitFile.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri, window } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/showQuickFileHistory.ts b/src/commands/showQuickFileHistory.ts index 4c5c6c5..67756d7 100644 --- a/src/commands/showQuickFileHistory.ts +++ b/src/commands/showQuickFileHistory.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, TextEditor, Uri } from 'vscode'; import type { Container } from '../container'; import { GitUri } from '../git/gitUri'; diff --git a/src/commands/showQuickRepoStatus.ts b/src/commands/showQuickRepoStatus.ts index 2719a3a..e67127e 100644 --- a/src/commands/showQuickRepoStatus.ts +++ b/src/commands/showQuickRepoStatus.ts @@ -1,4 +1,3 @@ -'use strict'; import { executeGitCommand } from '../commands'; import type { Container } from '../container'; import { Command, command, Commands } from './common'; diff --git a/src/commands/showQuickStashList.ts b/src/commands/showQuickStashList.ts index 3a7b759..34910a0 100644 --- a/src/commands/showQuickStashList.ts +++ b/src/commands/showQuickStashList.ts @@ -1,4 +1,3 @@ -'use strict'; import { executeGitCommand } from '../commands'; import type { Container } from '../container'; import { Command, command, Commands } from './common'; diff --git a/src/commands/showView.ts b/src/commands/showView.ts index 8e7d841..314cfb4 100644 --- a/src/commands/showView.ts +++ b/src/commands/showView.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands } from 'vscode'; import { ContextKeys, setContext, SyncedState } from '../constants'; import type { Container } from '../container'; diff --git a/src/commands/stashApply.ts b/src/commands/stashApply.ts index 903a249..f80125a 100644 --- a/src/commands/stashApply.ts +++ b/src/commands/stashApply.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitActions } from '../commands'; import type { Container } from '../container'; import { GitStashCommit, GitStashReference } from '../git/models'; diff --git a/src/commands/stashSave.ts b/src/commands/stashSave.ts index b1870fa..5e3b3c2 100644 --- a/src/commands/stashSave.ts +++ b/src/commands/stashSave.ts @@ -1,4 +1,3 @@ -'use strict'; import { Uri } from 'vscode'; import type { ScmResource } from '../@types/vscode.git.resources'; import { ScmResourceGroupType } from '../@types/vscode.git.resources.enums'; diff --git a/src/commands/switchMode.ts b/src/commands/switchMode.ts index 7753eab..70ca3f6 100644 --- a/src/commands/switchMode.ts +++ b/src/commands/switchMode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ConfigurationTarget } from 'vscode'; import { configuration } from '../configuration'; import type { Container } from '../container'; diff --git a/src/commands/toggleCodeLens.ts b/src/commands/toggleCodeLens.ts index ea2b79c..58ebceb 100644 --- a/src/commands/toggleCodeLens.ts +++ b/src/commands/toggleCodeLens.ts @@ -1,4 +1,3 @@ -'use strict'; import type { Container } from '../container'; import { command, Command, Commands } from './common'; diff --git a/src/commands/toggleFileAnnotations.ts b/src/commands/toggleFileAnnotations.ts index 2c8cccd..e871b30 100644 --- a/src/commands/toggleFileAnnotations.ts +++ b/src/commands/toggleFileAnnotations.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, TextEditorEdit, Uri, window } from 'vscode'; import { AnnotationContext } from '../annotations/annotationProvider'; import { ChangesAnnotationContext } from '../annotations/gutterChangesAnnotationProvider'; diff --git a/src/comparers.ts b/src/comparers.ts index 434c52c..afd9447 100644 --- a/src/comparers.ts +++ b/src/comparers.ts @@ -1,4 +1,3 @@ -'use strict'; import { TextEditor, Uri } from 'vscode'; abstract class Comparer { diff --git a/src/config.ts b/src/config.ts index dd7ee52..41d695c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,4 +1,3 @@ -'use strict'; import { DateTimeFormat } from './system/date'; export const enum OutputLevel { diff --git a/src/configuration.ts b/src/configuration.ts index 79e1e6c..c44f3ca 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -1,4 +1,3 @@ -'use strict'; export * from './config'; import { diff --git a/src/constants.ts b/src/constants.ts index 5cc51d5..0bda641 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, TextDocument, TextEditor, window } from 'vscode'; import { ViewShowBranchComparison } from './config'; import { SearchPattern } from './git/search'; diff --git a/src/container.ts b/src/container.ts index b36391a..5d896f6 100644 --- a/src/container.ts +++ b/src/container.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, ConfigurationChangeEvent, ConfigurationScope, Event, EventEmitter, ExtensionContext } from 'vscode'; import { getSupportedGitProviders } from '@env/git'; import { Autolinks } from './annotations/autolinks'; diff --git a/src/emojis.ts b/src/emojis.ts index 223c627..09c2a9f 100644 --- a/src/emojis.ts +++ b/src/emojis.ts @@ -1,4 +1,3 @@ -'use strict'; import emojis from './emojis.json'; const emojiRegex = /:([-+_a-z0-9]+):/g; diff --git a/src/env/node/git/git.ts b/src/env/node/git/git.ts index 0f92ea6..1fc364e 100644 --- a/src/env/node/git/git.ts +++ b/src/env/node/git/git.ts @@ -1,5 +1,4 @@ /* eslint-disable @typescript-eslint/naming-convention */ -'use strict'; import { Uri, window, workspace } from 'vscode'; import { hrtime } from '@env/hrtime'; import { GlyphChars } from '../../../constants'; diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index d54122e..9400847 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -1,4 +1,3 @@ -'use strict'; import { readdir, realpath } from 'fs'; import { hostname, userInfo } from 'os'; import { resolve as resolvePath } from 'path'; diff --git a/src/env/node/git/locator.ts b/src/env/node/git/locator.ts index 820fa3d..5ea77f7 100644 --- a/src/env/node/git/locator.ts +++ b/src/env/node/git/locator.ts @@ -1,4 +1,3 @@ -'use strict'; import { join as joinPaths } from 'path'; import { GlyphChars } from '../../../constants'; import { LogLevel } from '../../../logger'; diff --git a/src/env/node/git/shell.ts b/src/env/node/git/shell.ts index 5667b7d..bc7dc9e 100644 --- a/src/env/node/git/shell.ts +++ b/src/env/node/git/shell.ts @@ -1,4 +1,3 @@ -'use strict'; import { ExecException, execFile } from 'child_process'; import { exists, existsSync, Stats, statSync } from 'fs'; import { join as joinPaths } from 'path'; diff --git a/src/errors.ts b/src/errors.ts index 8306d22..85ae225 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -1,4 +1,3 @@ -'use strict'; import { Uri } from 'vscode'; export const enum AuthenticationErrorReason { diff --git a/src/extension.ts b/src/extension.ts index d866ce5..cebc423 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,4 +1,3 @@ -'use strict'; import { version as codeVersion, commands, env, ExtensionContext, extensions, window, workspace } from 'vscode'; import { Api } from './api/api'; import type { CreatePullRequestActionContext, GitLensApi, OpenPullRequestActionContext } from './api/gitlens'; diff --git a/src/git/commandOptions.ts b/src/git/commandOptions.ts index 35ea154..34c360c 100644 --- a/src/git/commandOptions.ts +++ b/src/git/commandOptions.ts @@ -1,5 +1,3 @@ -'use strict'; - export const enum GitErrorHandling { Throw = 0, Ignore = 1, diff --git a/src/git/errors.ts b/src/git/errors.ts index ed04828..93a2dc6 100644 --- a/src/git/errors.ts +++ b/src/git/errors.ts @@ -1,5 +1,3 @@ -'use strict'; - export const enum StashApplyErrorReason { WorkingChanges = 1, } diff --git a/src/git/formatters.ts b/src/git/formatters.ts index ab07b49..6bd12c5 100644 --- a/src/git/formatters.ts +++ b/src/git/formatters.ts @@ -1,4 +1,2 @@ -'use strict'; - export * from './formatters/commitFormatter'; export * from './formatters/statusFormatter'; diff --git a/src/git/formatters/commitFormatter.ts b/src/git/formatters/commitFormatter.ts index 1c762ef..c14e0b7 100644 --- a/src/git/formatters/commitFormatter.ts +++ b/src/git/formatters/commitFormatter.ts @@ -1,4 +1,3 @@ -'use strict'; import { Uri } from 'vscode'; import type { HoverCommandsActionContext, OpenPullRequestActionContext } from '../../api/gitlens'; import { getPresenceDataUri } from '../../avatars'; diff --git a/src/git/formatters/formatter.ts b/src/git/formatters/formatter.ts index 52167fa..96b4744 100644 --- a/src/git/formatters/formatter.ts +++ b/src/git/formatters/formatter.ts @@ -1,4 +1,3 @@ -'use strict'; import { Strings } from '../../system'; const emptyStr = ''; diff --git a/src/git/formatters/statusFormatter.ts b/src/git/formatters/statusFormatter.ts index 8c4ef1a..aaea118 100644 --- a/src/git/formatters/statusFormatter.ts +++ b/src/git/formatters/statusFormatter.ts @@ -1,4 +1,3 @@ -'use strict'; import { GlyphChars } from '../../constants'; import { Strings } from '../../system'; import { basename } from '../../system/path'; diff --git a/src/git/fsProvider.ts b/src/git/fsProvider.ts index cd70a6a..2bec3b3 100644 --- a/src/git/fsProvider.ts +++ b/src/git/fsProvider.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, Event, diff --git a/src/git/gitProviderService.ts b/src/git/gitProviderService.ts index 5474d56..0e55849 100644 --- a/src/git/gitProviderService.ts +++ b/src/git/gitProviderService.ts @@ -1,4 +1,3 @@ -'use strict'; import { encodingExists } from 'iconv-lite'; import { ConfigurationChangeEvent, diff --git a/src/git/gitUri.ts b/src/git/gitUri.ts index 3eb8b49..d4f350d 100644 --- a/src/git/gitUri.ts +++ b/src/git/gitUri.ts @@ -1,4 +1,3 @@ -'use strict'; import { Uri } from 'vscode'; import { decodeUtf8Hex, encodeUtf8Hex } from '@env/hex'; import { UriComparer } from '../comparers'; diff --git a/src/git/models.ts b/src/git/models.ts index b2f717a..d29252a 100644 --- a/src/git/models.ts +++ b/src/git/models.ts @@ -1,4 +1,3 @@ -'use strict'; export * from './models/author'; export * from './models/blame'; export * from './models/blameCommit'; diff --git a/src/git/models/author.ts b/src/git/models/author.ts index ce2449d..6708e71 100644 --- a/src/git/models/author.ts +++ b/src/git/models/author.ts @@ -1,4 +1,3 @@ -'use strict'; import { RemoteProviderReference } from './remoteProvider'; export interface Account { diff --git a/src/git/models/blame.ts b/src/git/models/blame.ts index be95bbd..ed77105 100644 --- a/src/git/models/blame.ts +++ b/src/git/models/blame.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitBlameCommit } from './blameCommit'; import { GitAuthor, GitCommitLine } from './commit'; diff --git a/src/git/models/blameCommit.ts b/src/git/models/blameCommit.ts index 3c2e8f8..be1f1d3 100644 --- a/src/git/models/blameCommit.ts +++ b/src/git/models/blameCommit.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitCommit, GitCommitLine, GitCommitType } from './commit'; export class GitBlameCommit extends GitCommit { diff --git a/src/git/models/branch.ts b/src/git/models/branch.ts index d2e06f9..be814cd 100644 --- a/src/git/models/branch.ts +++ b/src/git/models/branch.ts @@ -1,4 +1,3 @@ -'use strict'; import { BranchSorting, configuration, DateStyle } from '../../configuration'; import { Starred, WorkspaceState } from '../../constants'; import { Container } from '../../container'; diff --git a/src/git/models/commit.ts b/src/git/models/commit.ts index 43a2d94..1d1b998 100644 --- a/src/git/models/commit.ts +++ b/src/git/models/commit.ts @@ -1,4 +1,3 @@ -'use strict'; import { Uri } from 'vscode'; import { getAvatarUri } from '../../avatars'; import { configuration, DateSource, DateStyle, GravatarDefaultStyle } from '../../configuration'; diff --git a/src/git/models/contributor.ts b/src/git/models/contributor.ts index 0a2166f..3995fbc 100644 --- a/src/git/models/contributor.ts +++ b/src/git/models/contributor.ts @@ -1,4 +1,3 @@ -'use strict'; import { Uri } from 'vscode'; import { getAvatarUri } from '../../avatars'; import { configuration, ContributorSorting, GravatarDefaultStyle } from '../../configuration'; diff --git a/src/git/models/defaultBranch.ts b/src/git/models/defaultBranch.ts index bc2e1f4..27d2c81 100644 --- a/src/git/models/defaultBranch.ts +++ b/src/git/models/defaultBranch.ts @@ -1,4 +1,3 @@ -'use strict'; import { RemoteProviderReference } from './remoteProvider'; export interface DefaultBranch { diff --git a/src/git/models/diff.ts b/src/git/models/diff.ts index 80da856..751ba88 100644 --- a/src/git/models/diff.ts +++ b/src/git/models/diff.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitDiffParser } from '../parsers/diffParser'; export interface GitDiffLine { diff --git a/src/git/models/file.ts b/src/git/models/file.ts index f8d8a12..405badb 100644 --- a/src/git/models/file.ts +++ b/src/git/models/file.ts @@ -1,4 +1,3 @@ -'use strict'; import { GlyphChars } from '../../constants'; import { Strings } from '../../system'; import { GitUri } from '../gitUri'; diff --git a/src/git/models/issue.ts b/src/git/models/issue.ts index 9251440..dfdfc5b 100644 --- a/src/git/models/issue.ts +++ b/src/git/models/issue.ts @@ -1,4 +1,3 @@ -'use strict'; import { ColorThemeKind, ThemeColor, ThemeIcon, window } from 'vscode'; import { Colors } from '../../constants'; import { RemoteProviderReference } from './remoteProvider'; diff --git a/src/git/models/log.ts b/src/git/models/log.ts index eaacd5d..5993ea5 100644 --- a/src/git/models/log.ts +++ b/src/git/models/log.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range } from 'vscode'; import { GitAuthor } from './commit'; import { GitLogCommit } from './logCommit'; diff --git a/src/git/models/logCommit.ts b/src/git/models/logCommit.ts index dbe725a..b65edef 100644 --- a/src/git/models/logCommit.ts +++ b/src/git/models/logCommit.ts @@ -1,4 +1,3 @@ -'use strict'; import { Uri } from 'vscode'; import { Container } from '../../container'; import { memoize, Strings } from '../../system'; diff --git a/src/git/models/merge.ts b/src/git/models/merge.ts index 847686a..663778f 100644 --- a/src/git/models/merge.ts +++ b/src/git/models/merge.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitBranchReference, GitRevisionReference } from '../models'; export interface GitMergeStatus { diff --git a/src/git/models/pullRequest.ts b/src/git/models/pullRequest.ts index 6ad1d76..9248434 100644 --- a/src/git/models/pullRequest.ts +++ b/src/git/models/pullRequest.ts @@ -1,4 +1,3 @@ -'use strict'; import { ColorThemeKind, ThemeColor, ThemeIcon, window } from 'vscode'; import { configuration, DateStyle } from '../../configuration'; import { Colors } from '../../constants'; diff --git a/src/git/models/rebase.ts b/src/git/models/rebase.ts index 60ea24d..ff7e914 100644 --- a/src/git/models/rebase.ts +++ b/src/git/models/rebase.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitBranchReference, GitRevisionReference } from '../models'; export interface GitRebaseStatus { diff --git a/src/git/models/reference.ts b/src/git/models/reference.ts index f2a184c..1dca9aa 100644 --- a/src/git/models/reference.ts +++ b/src/git/models/reference.ts @@ -1,4 +1,3 @@ -'use strict'; import { GlyphChars } from '../../constants'; import { Container } from '../../container'; import { GitBranch } from './branch'; diff --git a/src/git/models/reflog.ts b/src/git/models/reflog.ts index 55abc07..ac530da 100644 --- a/src/git/models/reflog.ts +++ b/src/git/models/reflog.ts @@ -1,4 +1,3 @@ -'use strict'; import { DateStyle } from '../../config'; import { Dates, memoize } from '../../system'; import { CommitDateFormatting, GitRevision } from '../models'; diff --git a/src/git/models/remote.ts b/src/git/models/remote.ts index dc64c55..42cf2bf 100644 --- a/src/git/models/remote.ts +++ b/src/git/models/remote.ts @@ -1,4 +1,3 @@ -'use strict'; import { WorkspaceState } from '../../constants'; import { Container } from '../../container'; import { Strings } from '../../system'; diff --git a/src/git/models/remoteProvider.ts b/src/git/models/remoteProvider.ts index 5be63ee..ce48b03 100644 --- a/src/git/models/remoteProvider.ts +++ b/src/git/models/remoteProvider.ts @@ -1,5 +1,3 @@ -'use strict'; - export interface RemoteProviderReference { readonly id: string; readonly name: string; diff --git a/src/git/models/repository.ts b/src/git/models/repository.ts index 64c8156..79066e8 100644 --- a/src/git/models/repository.ts +++ b/src/git/models/repository.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, ConfigurationChangeEvent, diff --git a/src/git/models/shortlog.ts b/src/git/models/shortlog.ts index 4488e87..128111d 100644 --- a/src/git/models/shortlog.ts +++ b/src/git/models/shortlog.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitContributor } from './contributor'; export interface GitShortLog { diff --git a/src/git/models/stash.ts b/src/git/models/stash.ts index 89508cd..b194d84 100644 --- a/src/git/models/stash.ts +++ b/src/git/models/stash.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitStashCommit } from './stashCommit'; export interface GitStash { diff --git a/src/git/models/stashCommit.ts b/src/git/models/stashCommit.ts index 6a9b90a..4262e54 100644 --- a/src/git/models/stashCommit.ts +++ b/src/git/models/stashCommit.ts @@ -1,4 +1,3 @@ -'use strict'; import { Container } from '../../container'; import { gate, memoize } from '../../system'; import { GitReference } from '../models'; diff --git a/src/git/models/status.ts b/src/git/models/status.ts index 3c1e6ae..d432855 100644 --- a/src/git/models/status.ts +++ b/src/git/models/status.ts @@ -1,4 +1,3 @@ -'use strict'; import { Uri } from 'vscode'; import { GlyphChars } from '../../constants'; import { Container } from '../../container'; diff --git a/src/git/models/tag.ts b/src/git/models/tag.ts index 499492f..c010dff 100644 --- a/src/git/models/tag.ts +++ b/src/git/models/tag.ts @@ -1,4 +1,3 @@ -'use strict'; import { configuration, DateStyle, TagSorting } from '../../configuration'; import { Dates, memoize, Strings } from '../../system'; import { GitReference, GitTagReference } from '../models'; diff --git a/src/git/models/tree.ts b/src/git/models/tree.ts index c68c2fc..6eaee3c 100644 --- a/src/git/models/tree.ts +++ b/src/git/models/tree.ts @@ -1,5 +1,3 @@ -'use strict'; - export interface GitTreeEntry { commitSha: string; path: string; diff --git a/src/git/models/user.ts b/src/git/models/user.ts index ff1bafd..27e79b1 100644 --- a/src/git/models/user.ts +++ b/src/git/models/user.ts @@ -1,5 +1,3 @@ -'use strict'; - export interface GitUser { name: string | undefined; email: string | undefined; diff --git a/src/git/parsers.ts b/src/git/parsers.ts index 7329399..aee87af 100644 --- a/src/git/parsers.ts +++ b/src/git/parsers.ts @@ -1,5 +1,3 @@ -'use strict'; - export * from './parsers/blameParser'; export * from './parsers/branchParser'; export * from './parsers/diffParser'; diff --git a/src/git/parsers/blameParser.ts b/src/git/parsers/blameParser.ts index 0b96a28..a775353 100644 --- a/src/git/parsers/blameParser.ts +++ b/src/git/parsers/blameParser.ts @@ -1,4 +1,3 @@ -'use strict'; import { debug, Strings } from '../../system'; import { normalizePath, relative } from '../../system/path'; import { GitAuthor, GitBlame, GitBlameCommit, GitCommitLine, GitRevision, GitUser } from '../models'; diff --git a/src/git/parsers/branchParser.ts b/src/git/parsers/branchParser.ts index 352114f..fdb8ff0 100644 --- a/src/git/parsers/branchParser.ts +++ b/src/git/parsers/branchParser.ts @@ -1,4 +1,3 @@ -'use strict'; import { debug } from '../../system'; import { GitBranch } from '../models/branch'; diff --git a/src/git/parsers/diffParser.ts b/src/git/parsers/diffParser.ts index 64be6cd..0bc95d3 100644 --- a/src/git/parsers/diffParser.ts +++ b/src/git/parsers/diffParser.ts @@ -1,4 +1,3 @@ -'use strict'; import { debug, Strings } from '../../system'; import { GitDiff, GitDiffHunk, GitDiffHunkLine, GitDiffLine, GitDiffShortStat } from '../models/diff'; import { GitFile, GitFileStatus } from '../models/file'; diff --git a/src/git/parsers/logParser.ts b/src/git/parsers/logParser.ts index aa6ea87..5db6883 100644 --- a/src/git/parsers/logParser.ts +++ b/src/git/parsers/logParser.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range } from 'vscode'; import { Arrays, debug, Strings } from '../../system'; import { normalizePath, relative } from '../../system/path'; diff --git a/src/git/parsers/reflogParser.ts b/src/git/parsers/reflogParser.ts index 58aaba5..f294a09 100644 --- a/src/git/parsers/reflogParser.ts +++ b/src/git/parsers/reflogParser.ts @@ -1,4 +1,3 @@ -'use strict'; import { debug } from '../../system'; import { GitReflog, GitReflogRecord } from '../models/reflog'; diff --git a/src/git/parsers/remoteParser.ts b/src/git/parsers/remoteParser.ts index cae0a43..f44b931 100644 --- a/src/git/parsers/remoteParser.ts +++ b/src/git/parsers/remoteParser.ts @@ -1,4 +1,3 @@ -'use strict'; import { debug } from '../../system'; import { GitRemote } from '../models'; import { GitRemoteType } from '../models/remote'; diff --git a/src/git/parsers/shortlogParser.ts b/src/git/parsers/shortlogParser.ts index 1790dbe..3153cf7 100644 --- a/src/git/parsers/shortlogParser.ts +++ b/src/git/parsers/shortlogParser.ts @@ -1,4 +1,3 @@ -'use strict'; import { debug } from '../../system'; import { GitContributor, GitShortLog, GitUser } from '../models'; diff --git a/src/git/parsers/stashParser.ts b/src/git/parsers/stashParser.ts index 8ec0100..f670ca3 100644 --- a/src/git/parsers/stashParser.ts +++ b/src/git/parsers/stashParser.ts @@ -1,4 +1,3 @@ -'use strict'; import { Arrays, debug, Strings } from '../../system'; import { normalizePath } from '../../system/path'; import { GitCommitType, GitFile, GitFileIndexStatus, GitStash, GitStashCommit } from '../models'; diff --git a/src/git/parsers/statusParser.ts b/src/git/parsers/statusParser.ts index f44cc01..f310785 100644 --- a/src/git/parsers/statusParser.ts +++ b/src/git/parsers/statusParser.ts @@ -1,4 +1,3 @@ -'use strict'; import { debug } from '../../system'; import { normalizePath } from '../../system/path'; import { GitStatus, GitStatusFile } from '../models'; diff --git a/src/git/parsers/tagParser.ts b/src/git/parsers/tagParser.ts index 4053436..32efc8b 100644 --- a/src/git/parsers/tagParser.ts +++ b/src/git/parsers/tagParser.ts @@ -1,4 +1,3 @@ -'use strict'; import { debug } from '../../system'; import { GitTag } from '../models'; diff --git a/src/git/parsers/treeParser.ts b/src/git/parsers/treeParser.ts index 4a5a137..20c613f 100644 --- a/src/git/parsers/treeParser.ts +++ b/src/git/parsers/treeParser.ts @@ -1,4 +1,3 @@ -'use strict'; import { debug } from '../../system'; import { GitTreeEntry } from '../models'; diff --git a/src/git/remotes/azure-devops.ts b/src/git/remotes/azure-devops.ts index 90cd149..b9bed06 100644 --- a/src/git/remotes/azure-devops.ts +++ b/src/git/remotes/azure-devops.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, Uri } from 'vscode'; import { DynamicAutolinkReference } from '../../annotations/autolinks'; import { AutolinkReference } from '../../config'; diff --git a/src/git/remotes/bitbucket-server.ts b/src/git/remotes/bitbucket-server.ts index aadc5ee..5ae2db6 100644 --- a/src/git/remotes/bitbucket-server.ts +++ b/src/git/remotes/bitbucket-server.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, Uri } from 'vscode'; import { DynamicAutolinkReference } from '../../annotations/autolinks'; import { AutolinkReference } from '../../config'; diff --git a/src/git/remotes/bitbucket.ts b/src/git/remotes/bitbucket.ts index 898750a..9dd5087 100644 --- a/src/git/remotes/bitbucket.ts +++ b/src/git/remotes/bitbucket.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, Uri } from 'vscode'; import { DynamicAutolinkReference } from '../../annotations/autolinks'; import { AutolinkReference } from '../../config'; diff --git a/src/git/remotes/custom.ts b/src/git/remotes/custom.ts index 53952f5..da3e99d 100644 --- a/src/git/remotes/custom.ts +++ b/src/git/remotes/custom.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, Uri } from 'vscode'; import { RemotesUrlsConfig } from '../../configuration'; import { Strings } from '../../system'; diff --git a/src/git/remotes/factory.ts b/src/git/remotes/factory.ts index 3391146..5dd16f8 100644 --- a/src/git/remotes/factory.ts +++ b/src/git/remotes/factory.ts @@ -1,4 +1,3 @@ -'use strict'; import { CustomRemoteType, RemotesConfig } from '../../configuration'; import { Logger } from '../../logger'; import { AzureDevOpsRemote } from './azure-devops'; diff --git a/src/git/remotes/gerrit.ts b/src/git/remotes/gerrit.ts index 36c48ca..cc32612 100644 --- a/src/git/remotes/gerrit.ts +++ b/src/git/remotes/gerrit.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, Uri } from 'vscode'; import { DynamicAutolinkReference } from '../../annotations/autolinks'; import { AutolinkReference } from '../../config'; diff --git a/src/git/remotes/gitea.ts b/src/git/remotes/gitea.ts index 4b9a0cd..f830af7 100644 --- a/src/git/remotes/gitea.ts +++ b/src/git/remotes/gitea.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, Uri } from 'vscode'; import { DynamicAutolinkReference } from '../../annotations/autolinks'; import { AutolinkReference } from '../../config'; diff --git a/src/git/remotes/github.ts b/src/git/remotes/github.ts index a2e0d61..a814664 100644 --- a/src/git/remotes/github.ts +++ b/src/git/remotes/github.ts @@ -1,4 +1,3 @@ -'use strict'; import { AuthenticationSession, Range, Uri } from 'vscode'; import { DynamicAutolinkReference } from '../../annotations/autolinks'; import { AutolinkReference } from '../../config'; diff --git a/src/git/remotes/gitlab.ts b/src/git/remotes/gitlab.ts index 8575296..a91102e 100644 --- a/src/git/remotes/gitlab.ts +++ b/src/git/remotes/gitlab.ts @@ -1,4 +1,3 @@ -'use strict'; import { Range, Uri } from 'vscode'; import { DynamicAutolinkReference } from '../../annotations/autolinks'; import { AutolinkReference } from '../../config'; diff --git a/src/git/remotes/provider.ts b/src/git/remotes/provider.ts index 4041366..ca3eb2d 100644 --- a/src/git/remotes/provider.ts +++ b/src/git/remotes/provider.ts @@ -1,4 +1,3 @@ -'use strict'; import { authentication, AuthenticationSession, diff --git a/src/git/search.ts b/src/git/search.ts index c658f92..f5ffcec 100644 --- a/src/git/search.ts +++ b/src/git/search.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitRevision, GitRevisionReference } from './models'; export type SearchOperators = diff --git a/src/github/github.ts b/src/github/github.ts index 350f2d5..b13d70b 100644 --- a/src/github/github.ts +++ b/src/github/github.ts @@ -1,4 +1,3 @@ -'use strict'; import { Octokit } from '@octokit/core'; import { GraphqlResponseError } from '@octokit/graphql'; import { RequestError } from '@octokit/request-error'; diff --git a/src/hovers/hovers.ts b/src/hovers/hovers.ts index aed9354..44ffd60 100644 --- a/src/hovers/hovers.ts +++ b/src/hovers/hovers.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, MarkdownString } from 'vscode'; import { hrtime } from '@env/hrtime'; import { DiffWithCommand, ShowQuickCommitCommand } from '../commands'; diff --git a/src/hovers/lineHoverController.ts b/src/hovers/lineHoverController.ts index 18067fe..00e86c8 100644 --- a/src/hovers/lineHoverController.ts +++ b/src/hovers/lineHoverController.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, ConfigurationChangeEvent, diff --git a/src/keyboard.ts b/src/keyboard.ts index 1f85fc4..17b0f75 100644 --- a/src/keyboard.ts +++ b/src/keyboard.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, Disposable } from 'vscode'; import { ContextKeys, setContext } from './constants'; import { Logger } from './logger'; diff --git a/src/logger.ts b/src/logger.ts index d8e7e1d..f3b3ad6 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -1,4 +1,3 @@ -'use strict'; import { ExtensionContext, ExtensionMode, OutputChannel, Uri, window } from 'vscode'; import { OutputLevel } from './configuration'; import { getCorrelationContext, getNextCorrelationId } from './system'; diff --git a/src/messages.ts b/src/messages.ts index 5bb774c..fdb065f 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -1,4 +1,3 @@ -'use strict'; import { ConfigurationTarget, env, MessageItem, Uri, window } from 'vscode'; import { configuration } from './configuration'; import { GitCommit } from './git/models'; diff --git a/src/partners.ts b/src/partners.ts index 01cf40b..9f6aca2 100644 --- a/src/partners.ts +++ b/src/partners.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationTokenSource, commands, Extension, ExtensionContext, extensions, Uri } from 'vscode'; import type { ActionContext, HoverCommandsActionContext } from './api/gitlens'; import { Commands, executeCommand, InviteToLiveShareCommandArgs } from './commands'; diff --git a/src/premium/github/github.ts b/src/premium/github/github.ts new file mode 100644 index 0000000..53ff399 --- /dev/null +++ b/src/premium/github/github.ts @@ -0,0 +1,1325 @@ +import { Octokit } from '@octokit/core'; +import { GraphqlResponseError } from '@octokit/graphql'; +import { RequestError } from '@octokit/request-error'; +import type { Endpoints, OctokitResponse, RequestParameters } from '@octokit/types'; +import fetch from '@env/fetch'; +import { isWeb } from '@env/platform'; +import { + AuthenticationError, + AuthenticationErrorReason, + ProviderRequestClientError, + ProviderRequestNotFoundError, +} from '../../errors'; +import { PagedResult } from '../../git/gitProvider'; +import { + type DefaultBranch, + GitFileIndexStatus, + type GitUser, + type IssueOrPullRequest, + type IssueOrPullRequestType, + PullRequest, + PullRequestState, +} from '../../git/models'; +import type { Account } from '../../git/models/author'; +import type { RichRemoteProvider } from '../../git/remotes/provider'; +import { LogCorrelationContext, Logger, LogLevel } from '../../logger'; +import { debug } from '../../system/decorators/log'; +import { Stopwatch } from '../../system/stopwatch'; + +const emptyPagedResult: PagedResult = Object.freeze({ values: [] }); +const emptyBlameResult: GitHubBlame = Object.freeze({ ranges: [] }); + +export class GitHubApi { + @debug({ args: { 0: p => p.name, 1: '' } }) + async getAccountForCommit( + provider: RichRemoteProvider, + token: string, + owner: string, + repo: string, + ref: string, + options?: { + baseUrl?: string; + avatarSize?: number; + }, + ): Promise { + const cc = Logger.getCorrelationContext(); + + interface QueryResult { + repository: + | { + object: + | { + author?: { + name: string | null; + email: string | null; + avatarUrl: string; + }; + } + | null + | undefined; + } + | null + | undefined; + } + + try { + const query = `query getAccountForCommit( + $owner: String! + $repo: String! + $ref: GitObjectID! + $avatarSize: Int +) { + repository(name: $repo, owner: $owner) { + object(oid: $ref) { + ... on Commit { + author { + name + email + avatarUrl(size: $avatarSize) + } + } + } + } +}`; + + const rsp = await this.graphql(token, query, { + ...options, + owner: owner, + repo: repo, + ref: ref, + }); + + const author = rsp?.repository?.object?.author; + if (author == null) return undefined; + + return { + provider: provider, + name: author.name ?? undefined, + email: author.email ?? undefined, + avatarUrl: author.avatarUrl, + }; + } catch (ex) { + return this.handleRequestError(ex, cc, undefined); + } + } + + @debug({ args: { 0: p => p.name, 1: '' } }) + async getAccountForEmail( + provider: RichRemoteProvider, + token: string, + owner: string, + repo: string, + email: string, + options?: { + baseUrl?: string; + avatarSize?: number; + }, + ): Promise { + const cc = Logger.getCorrelationContext(); + + interface QueryResult { + search: + | { + nodes: + | { + name: string | null; + email: string | null; + avatarUrl: string; + }[] + | null + | undefined; + } + | null + | undefined; + } + + try { + const query = `query getAccountForEmail( + $emailQuery: String! + $avatarSize: Int +) { + search(type: USER, query: $emailQuery, first: 1) { + nodes { + ... on User { + name + email + avatarUrl(size: $avatarSize) + } + } + } +}`; + + const rsp = await this.graphql(token, query, { + ...options, + owner: owner, + repo: repo, + emailQuery: `in:email ${email}`, + }); + + const author = rsp?.search?.nodes?.[0]; + if (author == null) return undefined; + + return { + provider: provider, + name: author.name ?? undefined, + email: author.email ?? undefined, + avatarUrl: author.avatarUrl, + }; + } catch (ex) { + return this.handleRequestError(ex, cc, undefined); + } + } + + @debug({ args: { 0: p => p.name, 1: '' } }) + async getDefaultBranch( + provider: RichRemoteProvider, + token: string, + owner: string, + repo: string, + options?: { + baseUrl?: string; + }, + ): Promise { + const cc = Logger.getCorrelationContext(); + + interface QueryResult { + repository: { + defaultBranchRef: { + name: string; + } | null; + } | null; + } + + try { + const query = `query getDefaultBranch( + $owner: String! + $repo: String! +) { + repository(name: $repo, owner: $owner) { + defaultBranchRef { + name + } + } +}`; + + const rsp = await this.graphql(token, query, { + ...options, + owner: owner, + repo: repo, + }); + + const defaultBranch = rsp?.repository?.defaultBranchRef?.name ?? undefined; + if (defaultBranch == null) return undefined; + + return { + provider: provider, + name: defaultBranch, + }; + } catch (ex) { + return this.handleRequestError(ex, cc, undefined); + } + } + + @debug({ args: { 0: p => p.name, 1: '' } }) + async getIssueOrPullRequest( + provider: RichRemoteProvider, + token: string, + owner: string, + repo: string, + number: number, + options?: { + baseUrl?: string; + }, + ): Promise { + const cc = Logger.getCorrelationContext(); + + interface QueryResult { + repository?: { issueOrPullRequest?: GitHubIssueOrPullRequest }; + } + + try { + const query = `query getIssueOrPullRequest( + $owner: String! + $repo: String! + $number: Int! + ) { + repository(name: $repo, owner: $owner) { + issueOrPullRequest(number: $number) { + __typename + ... on Issue { + createdAt + closed + closedAt + title + url + } + ... on PullRequest { + createdAt + closed + closedAt + title + url + } + } + } + }`; + + const rsp = await this.graphql(token, query, { + ...options, + owner: owner, + repo: repo, + number: number, + }); + + const issue = rsp?.repository?.issueOrPullRequest; + if (issue == null) return undefined; + + return { + provider: provider, + type: issue.type, + id: String(number), + date: new Date(issue.createdAt), + title: issue.title, + closed: issue.closed, + closedDate: issue.closedAt == null ? undefined : new Date(issue.closedAt), + url: issue.url, + }; + } catch (ex) { + return this.handleRequestError(ex, cc, undefined); + } + } + + @debug({ args: { 0: p => p.name, 1: '' } }) + async getPullRequestForBranch( + provider: RichRemoteProvider, + token: string, + owner: string, + repo: string, + branch: string, + options?: { + baseUrl?: string; + avatarSize?: number; + include?: GitHubPullRequestState[]; + }, + ): Promise { + const cc = Logger.getCorrelationContext(); + + interface QueryResult { + repository: + | { + refs: { + nodes: { + associatedPullRequests?: { + nodes?: GitHubPullRequest[]; + }; + }[]; + }; + } + | null + | undefined; + } + + try { + const query = `query getPullRequestForBranch( + $owner: String! + $repo: String! + $branch: String! + $limit: Int! + $include: [PullRequestState!] + $avatarSize: Int +) { + repository(name: $repo, owner: $owner) { + refs(query: $branch, refPrefix: "refs/heads/", first: 1) { + nodes { + associatedPullRequests(first: $limit, orderBy: {field: UPDATED_AT, direction: DESC}, states: $include) { + nodes { + author { + login + avatarUrl(size: $avatarSize) + url + } + permalink + number + title + state + updatedAt + closedAt + mergedAt + repository { + isFork + owner { + login + } + } + } + } + } + } + } +}`; + + const rsp = await this.graphql(token, query, { + ...options, + owner: owner, + repo: repo, + branch: branch, + // Since GitHub sort doesn't seem to really work, look for a max of 10 PRs and then sort them ourselves + limit: 10, + }); + + // If the pr is not from a fork, keep it e.g. show root pr's on forks, otherwise, ensure the repo owners match + const prs = rsp?.repository?.refs.nodes[0]?.associatedPullRequests?.nodes?.filter( + pr => !pr.repository.isFork || pr.repository.owner.login === owner, + ); + if (prs == null || prs.length === 0) return undefined; + + if (prs.length > 1) { + prs.sort( + (a, b) => + (a.repository.owner.login === owner ? -1 : 1) - (b.repository.owner.login === owner ? -1 : 1) || + (a.state === 'OPEN' ? -1 : 1) - (b.state === 'OPEN' ? -1 : 1) || + new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime(), + ); + } + + return GitHubPullRequest.from(prs[0], provider); + } catch (ex) { + return this.handleRequestError(ex, cc, undefined); + } + } + + @debug({ args: { 0: p => p.name, 1: '' } }) + async getPullRequestForCommit( + provider: RichRemoteProvider, + token: string, + owner: string, + repo: string, + ref: string, + options?: { + baseUrl?: string; + avatarSize?: number; + }, + ): Promise { + const cc = Logger.getCorrelationContext(); + + interface QueryResult { + repository: + | { + object?: { + associatedPullRequests?: { + nodes?: GitHubPullRequest[]; + }; + }; + } + | null + | undefined; + } + + try { + const query = `query getPullRequestForCommit( + $owner: String! + $repo: String! + $ref: GitObjectID! + $avatarSize: Int +) { + repository(name: $repo, owner: $owner) { + object(oid: $ref) { + ... on Commit { + associatedPullRequests(first: 2, orderBy: {field: UPDATED_AT, direction: DESC}) { + nodes { + author { + login + avatarUrl(size: $avatarSize) + url + } + permalink + number + title + state + updatedAt + closedAt + mergedAt + repository { + isFork + owner { + login + } + } + } + } + } + } + } +}`; + + const rsp = await this.graphql(token, query, { + ...options, + owner: owner, + repo: repo, + ref: ref, + }); + + // If the pr is not from a fork, keep it e.g. show root pr's on forks, otherwise, ensure the repo owners match + const prs = rsp?.repository?.object?.associatedPullRequests?.nodes?.filter( + pr => !pr.repository.isFork || pr.repository.owner.login === owner, + ); + if (prs == null || prs.length === 0) return undefined; + + if (prs.length > 1) { + prs.sort( + (a, b) => + (a.repository.owner.login === owner ? -1 : 1) - (b.repository.owner.login === owner ? -1 : 1) || + (a.state === 'OPEN' ? -1 : 1) - (b.state === 'OPEN' ? -1 : 1) || + new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime(), + ); + } + + return GitHubPullRequest.from(prs[0], provider); + } catch (ex) { + return this.handleRequestError(ex, cc, undefined); + } + } + + @debug({ args: { 0: '' } }) + async getBlame(token: string, owner: string, repo: string, ref: string, path: string): Promise { + const cc = Logger.getCorrelationContext(); + + interface QueryResult { + viewer: { name: string }; + repository: + | { + object: { + blame: { + ranges: GitHubBlameRange[]; + }; + }; + } + | null + | undefined; + } + + try { + const query = `query getBlameRanges( + $owner: String! + $repo: String! + $ref: String! + $path: String! +) { + viewer { name } + repository(owner: $owner, name: $repo) { + object(expression: $ref) { + ...on Commit { + blame(path: $path) { + ranges { + startingLine + endingLine + age + commit { + oid + parents(first: 3) { nodes { oid } } + message + author { + avatarUrl + date + email + name + } + committer { date } + } + } + } + } + } + } +}`; + const rsp = await this.graphql(token, query, { + owner: owner, + repo: repo, + ref: ref, + path: path, + }); + if (rsp == null) return emptyBlameResult; + + const ranges = rsp.repository?.object?.blame?.ranges; + if (ranges == null || ranges.length === 0) return { ranges: [], viewer: rsp.viewer?.name }; + + return { ranges: ranges, viewer: rsp.viewer?.name }; + } catch (ex) { + return this.handleRequestError(ex, cc, emptyBlameResult); + } + } + + @debug({ args: { 0: '' } }) + async getBranches( + token: string, + owner: string, + repo: string, + options?: { query?: string; cursor?: string; limit?: number }, + ): Promise> { + const cc = Logger.getCorrelationContext(); + + interface QueryResult { + repository: + | { + refs: { + pageInfo: { + endCursor: string; + hasNextPage: boolean; + }; + nodes: GitHubBranch[]; + }; + } + | null + | undefined; + } + + try { + const query = `query getBranches( + $owner: String! + $repo: String! + $branchQuery: String + $cursor: String + $limit: Int = 100 +) { + repository(owner: $owner, name: $repo) { + refs(query: $branchQuery, refPrefix: "refs/heads/", first: $limit, after: $cursor, orderBy: { field: TAG_COMMIT_DATE, direction: DESC }) { + pageInfo { + endCursor + hasNextPage + } + nodes { + name + target { + oid + commitUrl + ...on Commit { + authoredDate + committedDate + } + } + } + } + } +}`; + + const rsp = await this.graphql(token, query, { + owner: owner, + repo: repo, + branchQuery: options?.query, + cursor: options?.cursor, + limit: Math.min(100, options?.limit ?? 100), + }); + if (rsp == null) return emptyPagedResult; + + const refs = rsp.repository?.refs; + if (refs == null) return emptyPagedResult; + + return { + paging: { + cursor: refs.pageInfo.endCursor, + more: refs.pageInfo.hasNextPage, + }, + values: refs.nodes, + }; + } catch (ex) { + return this.handleRequestError(ex, cc, emptyPagedResult); + } + } + + @debug({ args: { 0: '' } }) + async getCommit( + token: string, + owner: string, + repo: string, + ref: string, + ): Promise<(GitHubCommit & { viewer?: string }) | undefined> { + const cc = Logger.getCorrelationContext(); + + try { + const rsp = await this.request(token, 'GET /repos/{owner}/{repo}/commits/{ref}', { + owner: owner, + repo: repo, + ref: ref, + }); + + const result = rsp?.data; + if (result == null) return undefined; + + return { + oid: result.sha, + parents: { nodes: result.parents.map(p => ({ oid: p.sha })) }, + message: result.commit.message, + additions: result.stats?.additions, + changedFiles: result.files?.length, + deletions: result.stats?.deletions, + author: { + date: result.commit.author?.date ?? result.commit.committer?.date ?? new Date().toString(), + email: result.commit.author?.email ?? undefined, + name: result.commit.author?.name ?? '', + }, + committer: { + date: result.commit.committer?.date ?? result.commit.author?.date ?? new Date().toString(), + }, + files: result.files, + }; + } catch (ex) { + return this.handleRequestError(ex, cc, undefined); + } + + // const results = await this.getCommits(token, owner, repo, ref, { limit: 1 }); + // if (results.values.length === 0) return undefined; + + // return { ...results.values[0], viewer: results.viewer }; + } + + @debug({ args: { 0: '' } }) + async getCommitForFile( + token: string, + owner: string, + repo: string, + ref: string, + path: string, + ): Promise<(GitHubCommit & { viewer?: string }) | undefined> { + const results = await this.getCommits(token, owner, repo, ref, { limit: 1, path: path }); + if (results.values.length === 0) return undefined; + + const commit = await this.getCommit(token, owner, repo, results.values[0].oid); + return { ...(commit ?? results.values[0]), viewer: results.viewer }; + } + + @debug({ args: { 0: '' } }) + async getCommits( + token: string, + owner: string, + repo: string, + ref: string, + options?: { cursor?: string; path?: string; limit?: number }, + ): Promise & { viewer?: string }> { + const cc = Logger.getCorrelationContext(); + + if (options?.limit === 1 && options?.path == null) { + interface QueryResult { + viewer: { name: string }; + repository: { object: GitHubCommit } | null | undefined; + } + + try { + const query = `query getCommit( + $owner: String! + $repo: String! + $ref: String! +) { + viewer { name } + repository(name: $repo owner: $owner) { + object(expression: $ref) { + ...on Commit { + oid + parents(first: 3) { nodes { oid } } + message + additions + changedFiles + deletions + author { + date + email + name + } + committer { date } + } + } + } +}`; + + const rsp = await this.graphql(token, query, { + owner: owner, + repo: repo, + ref: ref, + }); + if (rsp == null) return emptyPagedResult; + + const commit = rsp.repository?.object; + return commit != null ? { values: [commit], viewer: rsp.viewer.name } : emptyPagedResult; + } catch (ex) { + return this.handleRequestError(ex, cc, emptyPagedResult); + } + } + + interface QueryResult { + viewer: { name: string }; + repository: + | { + object: + | { + history: { + pageInfo: { + endCursor: string; + hasNextPage: boolean; + }; + nodes: GitHubCommit[]; + }; + } + | null + | undefined; + } + | null + | undefined; + } + + try { + const query = `query getCommits( + $owner: String! + $repo: String! + $ref: String! + $path: String + $cursor: String + $limit: Int = 100 +) { + viewer { name } + repository(name: $repo, owner: $owner) { + object(expression: $ref) { + ... on Commit { + history(first: $limit, path: $path, after: $cursor) { + pageInfo { + endCursor + hasNextPage + } + nodes { ... on Commit { ...commit } } + } + } + } + } +} + +fragment commit on Commit { + oid + message + parents(first: 100) { nodes { oid } } + author { + date + email + name + } + committer { date } +}`; + + const rsp = await this.graphql(token, query, { + owner: owner, + repo: repo, + ref: ref, + cursor: options?.cursor, + path: options?.path, + limit: Math.min(100, options?.limit ?? 100), + }); + const history = rsp?.repository?.object?.history; + if (history == null) return emptyPagedResult; + + return { + paging: { + cursor: history.pageInfo.endCursor, + more: history.pageInfo.hasNextPage, + }, + values: history.nodes, + viewer: rsp?.viewer.name, + }; + } catch (ex) { + return this.handleRequestError(ex, cc, emptyPagedResult); + } + } + + @debug({ args: { 0: '' } }) + async getDefaultBranchName(token: string, owner: string, repo: string): Promise { + const cc = Logger.getCorrelationContext(); + + interface QueryResult { + repository: { + defaultBranchRef: + | { + name: string; + target: { oid: string }; + } + | null + | undefined; + }; + } + + try { + const query = `query getDefaultBranchAndTip( + $owner: String! + $repo: String! +) { + repository(owner: $owner, name: $repo) { + defaultBranchRef { + name + target { oid } + } + } +}`; + + const rsp = await this.graphql(token, query, { + owner: owner, + repo: repo, + }); + if (rsp == null) return undefined; + + return rsp.repository?.defaultBranchRef?.name ?? undefined; + } catch (ex) { + return this.handleRequestError(ex, cc, undefined); + } + } + + @debug({ args: { 0: '' } }) + async getCurrentUser(token: string, owner: string, repo: string): Promise { + const cc = Logger.getCorrelationContext(); + + interface QueryResult { + viewer: { name: string }; + repository: + | { + viewerPermission: string; + } + | null + | undefined; + } + + try { + const query = `query getCurrentUser( + $owner: String! + $repo: String! +) { + viewer { name } + repository(owner: $owner, name: $repo) { + viewerPermission + } +}`; + + const rsp = await this.graphql(token, query, { + owner: owner, + repo: repo, + }); + if (rsp == null) return undefined; + + return { name: rsp.viewer?.name, email: undefined }; + } catch (ex) { + return this.handleRequestError(ex, cc, undefined); + } + } + + @debug({ args: { 0: '' } }) + async getTags( + token: string, + owner: string, + repo: string, + options?: { query?: string; cursor?: string; limit?: number }, + ): Promise> { + const cc = Logger.getCorrelationContext(); + + interface QueryResult { + repository: + | { + refs: { + pageInfo: { + endCursor: string; + hasNextPage: boolean; + }; + nodes: GitHubTag[]; + }; + } + | null + | undefined; + } + + try { + const query = `query getTags( + $owner: String! + $repo: String! + $tagQuery: String + $cursor: String + $limit: Int = 100 +) { + repository(owner: $owner, name: $repo) { + refs(query: $tagQuery, refPrefix: "refs/tags/", first: $limit, after: $cursor, orderBy: { field: TAG_COMMIT_DATE, direction: DESC }) { + pageInfo { + endCursor + hasNextPage + } + nodes { + name + target { + oid + commitUrl + ...on Commit { + authoredDate + committedDate + message + } + ...on Tag { + message + tagger { date } + } + } + } + } + } +}`; + + const rsp = await this.graphql(token, query, { + owner: owner, + repo: repo, + tagQuery: options?.query, + cursor: options?.cursor, + limit: Math.min(100, options?.limit ?? 100), + }); + if (rsp == null) return emptyPagedResult; + + const refs = rsp.repository?.refs; + if (refs == null) return emptyPagedResult; + + return { + paging: { + cursor: refs.pageInfo.endCursor, + more: refs.pageInfo.hasNextPage, + }, + values: refs.nodes, + }; + } catch (ex) { + return this.handleRequestError(ex, cc, emptyPagedResult); + } + } + + @debug({ args: { 0: '' } }) + async resolveReference( + token: string, + owner: string, + repo: string, + ref: string, + path?: string, + ): Promise { + const cc = Logger.getCorrelationContext(); + + try { + if (!path) { + interface QueryResult { + repository: { object: { oid: string } } | null | undefined; + } + + const query = `query resolveReference( + $owner: String! + $repo: String! + $ref: String! +) { + repository(owner: $owner, name: $repo) { + object(expression: $ref) { + oid + } + } +}`; + + const rsp = await this.graphql(token, query, { + owner: owner, + repo: repo, + ref: ref, + }); + return rsp?.repository?.object?.oid ?? undefined; + } + + interface QueryResult { + repository: + | { + object: { + history: { + nodes: { oid: string }[]; + }; + }; + } + | null + | undefined; + } + + const query = `query resolveReference( + $owner: String! + $repo: String! + $ref: String! + $path: String! +) { + repository(owner: $owner, name: $repo) { + object(expression: $ref) { + ... on Commit { + history(first: 1, path: $path) { + nodes { oid } + } + } + } + } +}`; + + const rsp = await this.graphql(token, query, { + owner: owner, + repo: repo, + ref: ref, + path: path, + }); + return rsp?.repository?.object?.history.nodes?.[0]?.oid ?? undefined; + } catch (ex) { + return this.handleRequestError(ex, cc, undefined); + } + } + + private _octokits = new Map(); + private octokit(token: string, options?: ConstructorParameters[0]): Octokit { + let octokit = this._octokits.get(token); + if (octokit == null) { + let defaults; + if (isWeb) { + function fetchCore(url: string, options: { headers?: Record }) { + if (options.headers != null) { + // Strip out the user-agent (since it causes warnings in a webworker) + const { 'user-agent': userAgent, ...headers } = options.headers; + if (userAgent) { + options.headers = headers; + } + } + return fetch(url, options); + } + + defaults = Octokit.defaults({ + auth: `token ${token}`, + request: { fetch: fetchCore }, + }); + } else { + defaults = Octokit.defaults({ auth: `token ${token}` }); + } + + octokit = new defaults(options); + this._octokits.set(token, octokit); + + if (Logger.logLevel === LogLevel.Debug || Logger.isDebugging) { + octokit.hook.wrap('request', async (request, options) => { + const stopwatch = new Stopwatch(`[GITHUB] ${options.method} ${options.url}`, { log: false }); + try { + return await request(options); + } finally { + let message; + try { + if (typeof options.query === 'string') { + const match = /(^[^({\n]+)/.exec(options.query); + message = ` ${match?.[1].trim() ?? options.query}`; + } + } catch {} + stopwatch.stop({ message: message }); + } + }); + } + } + + return octokit; + } + + private async graphql(token: string, query: string, variables: { [key: string]: any }): Promise { + try { + return await this.octokit(token).graphql(query, variables); + } catch (ex) { + if (ex instanceof GraphqlResponseError) { + switch (ex.errors?.[0]?.type) { + case 'NOT_FOUND': + throw new ProviderRequestNotFoundError(ex); + case 'FORBIDDEN': + throw new AuthenticationError('github', AuthenticationErrorReason.Forbidden, ex); + } + } + + throw ex; + } + } + + private async request( + token: string, + route: keyof Endpoints | R, + options?: R extends keyof Endpoints ? Endpoints[R]['parameters'] & RequestParameters : RequestParameters, + ): Promise> { + try { + return (await this.octokit(token).request(route, options)) as any; + } catch (ex) { + if (ex instanceof RequestError) { + switch (ex.status) { + case 404: // Not found + case 410: // Gone + case 422: // Unprocessable Entity + throw new ProviderRequestNotFoundError(ex); + // case 429: //Too Many Requests + case 401: // Unauthorized + throw new AuthenticationError('github', AuthenticationErrorReason.Unauthorized, ex); + case 403: // Forbidden + throw new AuthenticationError('github', AuthenticationErrorReason.Forbidden, ex); + case 500: // Internal Server Error + if (ex.response != null) { + // TODO@eamodio: Handle GitHub down errors + } + break; + default: + if (ex.status >= 400 && ex.status < 500) throw new ProviderRequestClientError(ex); + break; + } + } + + throw ex; + } + } + + private handleRequestError(ex: unknown | Error, cc: LogCorrelationContext | undefined, defaultValue: T): T { + if (ex instanceof ProviderRequestNotFoundError) return defaultValue; + + Logger.error(ex, cc); + debugger; + throw ex; + } +} + +export interface GitHubBlame { + ranges: GitHubBlameRange[]; + viewer?: string; +} + +export interface GitHubBlameRange { + startingLine: number; + endingLine: number; + age: number; + commit: { + oid: string; + parents: { nodes: { oid: string }[] }; + message: string; + author: { + avatarUrl: string; + date: string; + email: string; + name: string; + }; + committer: { + date: string; + }; + }; +} + +export interface GitHubBranch { + name: string; + target: { + oid: string; + commitUrl: string; + authoredDate: string; + committedDate: string; + }; +} + +export interface GitHubCommit { + oid: string; + parents: { nodes: { oid: string }[] }; + message: string; + additions: number | undefined; + changedFiles: number | undefined; + deletions: number | undefined; + author: { + date: string; + email: string | undefined; + name: string; + }; + committer: { date: string }; + + files?: Endpoints['GET /repos/{owner}/{repo}/commits/{ref}']['response']['data']['files']; +} + +interface GitHubIssueOrPullRequest { + type: IssueOrPullRequestType; + number: number; + createdAt: string; + closed: boolean; + closedAt: string | null; + title: string; + url: string; +} + +type GitHubPullRequestState = 'OPEN' | 'CLOSED' | 'MERGED'; + +interface GitHubPullRequest { + author: { + login: string; + avatarUrl: string; + url: string; + }; + permalink: string; + number: number; + title: string; + state: GitHubPullRequestState; + updatedAt: string; + closedAt: string | null; + mergedAt: string | null; + repository: { + isFork: boolean; + owner: { + login: string; + }; + }; +} + +export namespace GitHubPullRequest { + export function from(pr: GitHubPullRequest, provider: RichRemoteProvider): PullRequest { + return new PullRequest( + provider, + { + name: pr.author.login, + avatarUrl: pr.author.avatarUrl, + url: pr.author.url, + }, + String(pr.number), + pr.title, + pr.permalink, + fromState(pr.state), + new Date(pr.updatedAt), + pr.closedAt == null ? undefined : new Date(pr.closedAt), + pr.mergedAt == null ? undefined : new Date(pr.mergedAt), + ); + } + + export function fromState(state: GitHubPullRequestState): PullRequestState { + return state === 'MERGED' + ? PullRequestState.Merged + : state === 'CLOSED' + ? PullRequestState.Closed + : PullRequestState.Open; + } + + export function toState(state: PullRequestState): GitHubPullRequestState { + return state === PullRequestState.Merged ? 'MERGED' : state === PullRequestState.Closed ? 'CLOSED' : 'OPEN'; + } +} + +export interface GitHubTag { + name: string; + target: { + oid: string; + commitUrl: string; + authoredDate: string; + committedDate: string; + message?: string | null; + tagger?: { + date: string; + } | null; + }; +} + +export function fromCommitFileStatus( + status: NonNullable[0]['status'], +): GitFileIndexStatus | undefined { + switch (status) { + case 'added': + return GitFileIndexStatus.Added; + case 'changed': + case 'modified': + return GitFileIndexStatus.Modified; + case 'removed': + return GitFileIndexStatus.Deleted; + case 'renamed': + return GitFileIndexStatus.Renamed; + case 'copied': + return GitFileIndexStatus.Copied; + } + return undefined; +} diff --git a/src/quickpicks.ts b/src/quickpicks.ts index d254312..222b0a0 100644 --- a/src/quickpicks.ts +++ b/src/quickpicks.ts @@ -1,5 +1,3 @@ -'use strict'; - import { configuration } from './configuration'; export function getQuickPickIgnoreFocusOut() { diff --git a/src/quickpicks/commitPicker.ts b/src/quickpicks/commitPicker.ts index 16cf8e2..bbee46d 100644 --- a/src/quickpicks/commitPicker.ts +++ b/src/quickpicks/commitPicker.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, window } from 'vscode'; import { configuration } from '../configuration'; import { Container } from '../container'; diff --git a/src/quickpicks/commitQuickPickItems.ts b/src/quickpicks/commitQuickPickItems.ts index 7b60753..b186184 100644 --- a/src/quickpicks/commitQuickPickItems.ts +++ b/src/quickpicks/commitQuickPickItems.ts @@ -1,4 +1,3 @@ -'use strict'; import { QuickPickItem, window } from 'vscode'; import { Commands, GitActions, OpenChangedFilesCommandArgs } from '../commands'; import { GlyphChars } from '../constants'; diff --git a/src/quickpicks/gitQuickPickItems.ts b/src/quickpicks/gitQuickPickItems.ts index a626077..9857b59 100644 --- a/src/quickpicks/gitQuickPickItems.ts +++ b/src/quickpicks/gitQuickPickItems.ts @@ -1,4 +1,3 @@ -'use strict'; import { QuickInputButton, QuickPickItem } from 'vscode'; import { Commands, GitCommandsCommand, GitCommandsCommandArgs } from '../commands'; import { GlyphChars } from '../constants'; diff --git a/src/quickpicks/modePicker.ts b/src/quickpicks/modePicker.ts index c6dbc64..65b5bfd 100644 --- a/src/quickpicks/modePicker.ts +++ b/src/quickpicks/modePicker.ts @@ -1,4 +1,3 @@ -'use strict'; import { QuickPickItem, window } from 'vscode'; import { GlyphChars } from '../constants'; import { Container } from '../container'; diff --git a/src/quickpicks/quickPicksItems.ts b/src/quickpicks/quickPicksItems.ts index aad6494..9994b8b 100644 --- a/src/quickpicks/quickPicksItems.ts +++ b/src/quickpicks/quickPicksItems.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, QuickPickItem } from 'vscode'; import { Commands, GitActions } from '../commands'; import { Container } from '../container'; diff --git a/src/quickpicks/referencePicker.ts b/src/quickpicks/referencePicker.ts index 72e65c0..c69fb65 100644 --- a/src/quickpicks/referencePicker.ts +++ b/src/quickpicks/referencePicker.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationTokenSource, Disposable, QuickPick, window } from 'vscode'; import { GitActions } from '../commands'; import { getBranchesAndOrTags, getValidateGitReferenceFn, QuickCommandButtons } from '../commands/quickCommand'; diff --git a/src/quickpicks/remoteProviderPicker.ts b/src/quickpicks/remoteProviderPicker.ts index 2f15efe..6e67497 100644 --- a/src/quickpicks/remoteProviderPicker.ts +++ b/src/quickpicks/remoteProviderPicker.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, env, QuickInputButton, ThemeIcon, Uri, window } from 'vscode'; import { Commands, OpenOnRemoteCommandArgs } from '../commands'; import { GlyphChars } from '../constants'; diff --git a/src/quickpicks/repositoryPicker.ts b/src/quickpicks/repositoryPicker.ts index 903c681..cf553d9 100644 --- a/src/quickpicks/repositoryPicker.ts +++ b/src/quickpicks/repositoryPicker.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, window } from 'vscode'; import { Container } from '../container'; import { Repository } from '../git/models'; diff --git a/src/statusbar/statusBarController.ts b/src/statusbar/statusBarController.ts index c79eed8..474dd6a 100644 --- a/src/statusbar/statusBarController.ts +++ b/src/statusbar/statusBarController.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, CancellationTokenSource, diff --git a/src/system.ts b/src/system.ts index 1ae6ce5..1959030 100644 --- a/src/system.ts +++ b/src/system.ts @@ -1,5 +1,3 @@ -'use strict'; - declare global { export type PartialDeep = T extends Record ? { [K in keyof T]?: PartialDeep } : T; export type PickPartialDeep = Omit, K> & { [P in K]?: Partial }; diff --git a/src/system/array.ts b/src/system/array.ts index 4b1775e..0c39736 100644 --- a/src/system/array.ts +++ b/src/system/array.ts @@ -1,5 +1,3 @@ -'use strict'; - export { findLastIndex, intersectionWith as intersection } from 'lodash-es'; export function chunk(source: T[], size: number): T[][] { diff --git a/src/system/date.ts b/src/system/date.ts index fabbd69..f52825f 100644 --- a/src/system/date.ts +++ b/src/system/date.ts @@ -1,5 +1,3 @@ -'use strict'; - // NOTE@eamodio If this changes we need to update the replacement function too (since its parameter number/order relies on the matching) const customDateTimeFormatParserRegex = /(?\[.*?\])|(?YYYY|YY)|(?M{1,4})|(?Do|DD?)|(?d{2,4})|(?HH?|hh?)|(?mm?)|(?ss?)|(?SSS)|(?A|a)|(?ZZ?)/g; diff --git a/src/system/decorators/gate.ts b/src/system/decorators/gate.ts index 5809d11..aaa71dc 100644 --- a/src/system/decorators/gate.ts +++ b/src/system/decorators/gate.ts @@ -1,4 +1,3 @@ -'use strict'; import { isPromise } from '../promise'; import { resolveProp } from './resolver'; diff --git a/src/system/decorators/log.ts b/src/system/decorators/log.ts index dfc044c..0dd1d06 100644 --- a/src/system/decorators/log.ts +++ b/src/system/decorators/log.ts @@ -1,4 +1,3 @@ -'use strict'; import { hrtime } from '@env/hrtime'; import { LogCorrelationContext, Logger, LogLevel } from '../../logger'; import { filterMap } from '../array'; diff --git a/src/system/decorators/memoize.ts b/src/system/decorators/memoize.ts index 6c6ba48..06d1da1 100644 --- a/src/system/decorators/memoize.ts +++ b/src/system/decorators/memoize.ts @@ -1,4 +1,3 @@ -'use strict'; import { resolveProp } from './resolver'; export function memoize any>(resolver?: (...args: Parameters) => string) { diff --git a/src/system/decorators/resolver.ts b/src/system/decorators/resolver.ts index 8390fbd..c4099a6 100644 --- a/src/system/decorators/resolver.ts +++ b/src/system/decorators/resolver.ts @@ -1,4 +1,3 @@ -'use strict'; import { Uri } from 'vscode'; function replacer(key: string, value: any): any { diff --git a/src/system/decorators/serialize.ts b/src/system/decorators/serialize.ts index 19cb0f5..48d8230 100644 --- a/src/system/decorators/serialize.ts +++ b/src/system/decorators/serialize.ts @@ -1,4 +1,3 @@ -'use strict'; import { resolveProp } from './resolver'; export function serialize any>( diff --git a/src/system/decorators/timeout.ts b/src/system/decorators/timeout.ts index b180765..725479d 100644 --- a/src/system/decorators/timeout.ts +++ b/src/system/decorators/timeout.ts @@ -1,4 +1,3 @@ -'use strict'; import { cancellable, isPromise } from '../promise'; export function timeout(timeout: number): any; diff --git a/src/system/encoding.ts b/src/system/encoding.ts index 61003dd..0a7b172 100644 --- a/src/system/encoding.ts +++ b/src/system/encoding.ts @@ -1,5 +1,3 @@ -'use strict'; - export function encodeUrl(url: string): string; export function encodeUrl(url: string | undefined): string | undefined; export function encodeUrl(url: string | undefined): string | undefined { diff --git a/src/system/function.ts b/src/system/function.ts index f2599c0..f14827d 100644 --- a/src/system/function.ts +++ b/src/system/function.ts @@ -1,4 +1,3 @@ -'use strict'; import { debounce as _debounce, once as _once } from 'lodash-es'; import { Disposable } from 'vscode'; diff --git a/src/system/iterable.ts b/src/system/iterable.ts index 057f07b..3bc8ebe 100644 --- a/src/system/iterable.ts +++ b/src/system/iterable.ts @@ -1,5 +1,3 @@ -'use strict'; - export function* chunk(source: T[], size: number): Iterable { let chunk: T[] = []; diff --git a/src/system/object.ts b/src/system/object.ts index b90cef2..9de9fd0 100644 --- a/src/system/object.ts +++ b/src/system/object.ts @@ -1,5 +1,3 @@ -'use strict'; - export { isEqual as areEqual } from 'lodash-es'; export function flatten(o: any, prefix: string = '', stringify: boolean = false): Record { diff --git a/src/system/path.ts b/src/system/path.ts index 334a348..7890ea9 100644 --- a/src/system/path.ts +++ b/src/system/path.ts @@ -1,4 +1,3 @@ -'use strict'; import { basename, dirname } from 'path'; import { Uri } from 'vscode'; import { isLinux, isWindows } from '@env/platform'; diff --git a/src/system/promise.ts b/src/system/promise.ts index b1f6a44..55b8897 100644 --- a/src/system/promise.ts +++ b/src/system/promise.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, Disposable } from 'vscode'; import { map } from './iterable'; diff --git a/src/system/searchTree.ts b/src/system/searchTree.ts index 0f12caf..347a15a 100644 --- a/src/system/searchTree.ts +++ b/src/system/searchTree.ts @@ -1,5 +1,4 @@ /* eslint-disable @typescript-eslint/strict-boolean-expressions */ -'use strict'; import { count, map, some } from './iterable'; import { CharCode, compareSubstring, compareSubstringIgnoreCase } from './string'; diff --git a/src/system/stopwatch.ts b/src/system/stopwatch.ts index c4470dc..557aa1e 100644 --- a/src/system/stopwatch.ts +++ b/src/system/stopwatch.ts @@ -1,4 +1,3 @@ -'use strict'; import { hrtime } from '@env/hrtime'; import { GlyphChars } from '../constants'; import { LogCorrelationContext, Logger, LogLevel } from '../logger'; diff --git a/src/system/string.ts b/src/system/string.ts index 61f0ef1..809e010 100644 --- a/src/system/string.ts +++ b/src/system/string.ts @@ -1,4 +1,3 @@ -'use strict'; import ansiRegex from 'ansi-regex'; import { md5 as _md5 } from '@env/crypto'; import { hrtime } from '@env/hrtime'; diff --git a/src/system/version.ts b/src/system/version.ts index c37956b..1ade6c7 100644 --- a/src/system/version.ts +++ b/src/system/version.ts @@ -1,4 +1,3 @@ -'use strict'; import { compareIgnoreCase } from './string'; declare type VersionComparisonResult = -1 | 0 | 1; diff --git a/src/terminal.ts b/src/terminal.ts index 3d4a646..161e9c2 100644 --- a/src/terminal.ts +++ b/src/terminal.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, Terminal, window } from 'vscode'; import { Container } from './container'; diff --git a/src/terminal/linkProvider.ts b/src/terminal/linkProvider.ts index 4f7f9fe..5286c0b 100644 --- a/src/terminal/linkProvider.ts +++ b/src/terminal/linkProvider.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, Disposable, TerminalLink, TerminalLinkContext, TerminalLinkProvider, window } from 'vscode'; import { Commands, diff --git a/src/trackers/documentTracker.ts b/src/trackers/documentTracker.ts index 760e6a9..bca45ac 100644 --- a/src/trackers/documentTracker.ts +++ b/src/trackers/documentTracker.ts @@ -1,4 +1,3 @@ -'use strict'; import { ConfigurationChangeEvent, Disposable, diff --git a/src/trackers/gitDocumentTracker.ts b/src/trackers/gitDocumentTracker.ts index 249a61d..50f3d20 100644 --- a/src/trackers/gitDocumentTracker.ts +++ b/src/trackers/gitDocumentTracker.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitBlame, GitDiff, GitLog } from '../git/models'; import { DocumentTracker } from './documentTracker'; diff --git a/src/trackers/gitLineTracker.ts b/src/trackers/gitLineTracker.ts index 2209319..1323caf 100644 --- a/src/trackers/gitLineTracker.ts +++ b/src/trackers/gitLineTracker.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, TextEditor } from 'vscode'; import { GlyphChars } from '../constants'; import { Container } from '../container'; diff --git a/src/trackers/lineTracker.ts b/src/trackers/lineTracker.ts index db8ffaa..58603bf 100644 --- a/src/trackers/lineTracker.ts +++ b/src/trackers/lineTracker.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, Event, EventEmitter, Selection, TextEditor, TextEditorSelectionChangeEvent, window } from 'vscode'; import { isTextEditor } from '../constants'; import { Logger } from '../logger'; diff --git a/src/trackers/trackedDocument.ts b/src/trackers/trackedDocument.ts index 7ef6bf9..e973d1c 100644 --- a/src/trackers/trackedDocument.ts +++ b/src/trackers/trackedDocument.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, Event, EventEmitter, TextDocument, TextEditor } from 'vscode'; import { ContextKeys, getEditorIfActive, isActiveDocument, setContext } from '../constants'; import { Container } from '../container'; diff --git a/src/views/branchesView.ts b/src/views/branchesView.ts index 7e19a16..1855a06 100644 --- a/src/views/branchesView.ts +++ b/src/views/branchesView.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, commands, diff --git a/src/views/commitsView.ts b/src/views/commitsView.ts index 158f1b8..cebb388 100644 --- a/src/views/commitsView.ts +++ b/src/views/commitsView.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, commands, diff --git a/src/views/contributorsView.ts b/src/views/contributorsView.ts index b793c93..212828f 100644 --- a/src/views/contributorsView.ts +++ b/src/views/contributorsView.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, commands, diff --git a/src/views/fileHistoryView.ts b/src/views/fileHistoryView.ts index 032db5d..4456853 100644 --- a/src/views/fileHistoryView.ts +++ b/src/views/fileHistoryView.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, ConfigurationChangeEvent, Disposable } from 'vscode'; import { configuration, FileHistoryViewConfig } from '../configuration'; import { ContextKeys, setContext } from '../constants'; diff --git a/src/views/lineHistoryView.ts b/src/views/lineHistoryView.ts index de50b24..1065b55 100644 --- a/src/views/lineHistoryView.ts +++ b/src/views/lineHistoryView.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, ConfigurationChangeEvent, Disposable } from 'vscode'; import { configuration, LineHistoryViewConfig } from '../configuration'; import { ContextKeys, setContext } from '../constants'; diff --git a/src/views/nodes.ts b/src/views/nodes.ts index 89ee4b3..6bb01c1 100644 --- a/src/views/nodes.ts +++ b/src/views/nodes.ts @@ -1,5 +1,3 @@ -'use strict'; - export * from './nodes/common'; export * from './nodes/viewNode'; diff --git a/src/views/nodes/autolinkedItemNode.ts b/src/views/nodes/autolinkedItemNode.ts index d6e747e..c1fda37 100644 --- a/src/views/nodes/autolinkedItemNode.ts +++ b/src/views/nodes/autolinkedItemNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { MarkdownString, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { GitUri } from '../../git/gitUri'; import { GitFile, IssueOrPullRequest, IssueOrPullRequestType } from '../../git/models'; diff --git a/src/views/nodes/autolinkedItemsNode.ts b/src/views/nodes/autolinkedItemsNode.ts index 7deefb7..dfb9009 100644 --- a/src/views/nodes/autolinkedItemsNode.ts +++ b/src/views/nodes/autolinkedItemsNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; import { GitUri } from '../../git/gitUri'; import { GitFile, GitLog, GitRemote, IssueOrPullRequest, PullRequest } from '../../git/models'; diff --git a/src/views/nodes/branchNode.ts b/src/views/nodes/branchNode.ts index e769037..2ed5568 100644 --- a/src/views/nodes/branchNode.ts +++ b/src/views/nodes/branchNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { MarkdownString, ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri, window } from 'vscode'; import { ViewBranchesLayout, ViewShowBranchComparison } from '../../configuration'; import { Colors, GlyphChars } from '../../constants'; diff --git a/src/views/nodes/branchOrTagFolderNode.ts b/src/views/nodes/branchOrTagFolderNode.ts index 62d39a1..3b3e8c3 100644 --- a/src/views/nodes/branchOrTagFolderNode.ts +++ b/src/views/nodes/branchOrTagFolderNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { GitUri } from '../../git/gitUri'; import { Arrays } from '../../system'; diff --git a/src/views/nodes/branchTrackingStatusFilesNode.ts b/src/views/nodes/branchTrackingStatusFilesNode.ts index 67ebf94..07188a7 100644 --- a/src/views/nodes/branchTrackingStatusFilesNode.ts +++ b/src/views/nodes/branchTrackingStatusFilesNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; import { ViewFilesLayout } from '../../configuration'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/branchTrackingStatusNode.ts b/src/views/nodes/branchTrackingStatusNode.ts index 4ea7135..234a038 100644 --- a/src/views/nodes/branchTrackingStatusNode.ts +++ b/src/views/nodes/branchTrackingStatusNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { MarkdownString, ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState, window } from 'vscode'; import { Colors } from '../../constants'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/branchesNode.ts b/src/views/nodes/branchesNode.ts index 7a4eb20..147cd85 100644 --- a/src/views/nodes/branchesNode.ts +++ b/src/views/nodes/branchesNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { ViewBranchesLayout } from '../../configuration'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/commitFileNode.ts b/src/views/nodes/commitFileNode.ts index 26dd102..03d0ed9 100644 --- a/src/views/nodes/commitFileNode.ts +++ b/src/views/nodes/commitFileNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Command, Selection, TreeItem, TreeItemCollapsibleState, Uri } from 'vscode'; import { Commands, DiffWithPreviousCommandArgs } from '../../commands'; import { StatusFileFormatter } from '../../git/formatters'; diff --git a/src/views/nodes/commitNode.ts b/src/views/nodes/commitNode.ts index a36fbf4..f6050d7 100644 --- a/src/views/nodes/commitNode.ts +++ b/src/views/nodes/commitNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Command, MarkdownString, ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { Commands, DiffWithPreviousCommandArgs } from '../../commands'; import { ViewFilesLayout } from '../../configuration'; diff --git a/src/views/nodes/compareBranchNode.ts b/src/views/nodes/compareBranchNode.ts index b44908e..99a096a 100644 --- a/src/views/nodes/compareBranchNode.ts +++ b/src/views/nodes/compareBranchNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { ViewShowBranchComparison } from '../../configuration'; import { BranchComparison, BranchComparisons, GlyphChars, WorkspaceState } from '../../constants'; diff --git a/src/views/nodes/comparePickerNode.ts b/src/views/nodes/comparePickerNode.ts index e59b553..423e6cb 100644 --- a/src/views/nodes/comparePickerNode.ts +++ b/src/views/nodes/comparePickerNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; import { GlyphChars, NamedRef } from '../../constants'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/compareResultsNode.ts b/src/views/nodes/compareResultsNode.ts index a70c164..6a2ee7d 100644 --- a/src/views/nodes/compareResultsNode.ts +++ b/src/views/nodes/compareResultsNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { NamedRef } from '../../constants'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/contributorNode.ts b/src/views/nodes/contributorNode.ts index 3879542..49738a1 100644 --- a/src/views/nodes/contributorNode.ts +++ b/src/views/nodes/contributorNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { MarkdownString, TreeItem, TreeItemCollapsibleState, window } from 'vscode'; import { getPresenceDataUri } from '../../avatars'; import { GlyphChars } from '../../constants'; diff --git a/src/views/nodes/contributorsNode.ts b/src/views/nodes/contributorsNode.ts index 7710725..a710911 100644 --- a/src/views/nodes/contributorsNode.ts +++ b/src/views/nodes/contributorsNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { GitUri } from '../../git/gitUri'; import { GitContributor, Repository } from '../../git/models'; diff --git a/src/views/nodes/fileHistoryNode.ts b/src/views/nodes/fileHistoryNode.ts index 20a9e61..84e9c00 100644 --- a/src/views/nodes/fileHistoryNode.ts +++ b/src/views/nodes/fileHistoryNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, TreeItem, TreeItemCollapsibleState, window } from 'vscode'; import { configuration } from '../../configuration'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/fileHistoryTrackerNode.ts b/src/views/nodes/fileHistoryTrackerNode.ts index 0f857a5..a48bc3d 100644 --- a/src/views/nodes/fileHistoryTrackerNode.ts +++ b/src/views/nodes/fileHistoryTrackerNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, FileType, TextEditor, TreeItem, TreeItemCollapsibleState, window, workspace } from 'vscode'; import { UriComparer } from '../../comparers'; import { ContextKeys, setContext } from '../../constants'; diff --git a/src/views/nodes/fileRevisionAsCommitNode.ts b/src/views/nodes/fileRevisionAsCommitNode.ts index 9989da7..136bcc8 100644 --- a/src/views/nodes/fileRevisionAsCommitNode.ts +++ b/src/views/nodes/fileRevisionAsCommitNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Command, MarkdownString, diff --git a/src/views/nodes/folderNode.ts b/src/views/nodes/folderNode.ts index 9c9638e..ca1aec8 100644 --- a/src/views/nodes/folderNode.ts +++ b/src/views/nodes/folderNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { ViewFilesLayout, ViewsFilesConfig } from '../../configuration'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/helpers.ts b/src/views/nodes/helpers.ts index 46bc907..7649b29 100644 --- a/src/views/nodes/helpers.ts +++ b/src/views/nodes/helpers.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitLogCommit } from '../../git/models'; import { MessageNode } from './common'; import { ContextValues, ViewNode } from './viewNode'; diff --git a/src/views/nodes/lineHistoryNode.ts b/src/views/nodes/lineHistoryNode.ts index 7f018d7..f7c73de 100644 --- a/src/views/nodes/lineHistoryNode.ts +++ b/src/views/nodes/lineHistoryNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, Selection, TreeItem, TreeItemCollapsibleState, window } from 'vscode'; import { GitUri } from '../../git/gitUri'; import { diff --git a/src/views/nodes/lineHistoryTrackerNode.ts b/src/views/nodes/lineHistoryTrackerNode.ts index 1aaf2bd..3105f95 100644 --- a/src/views/nodes/lineHistoryTrackerNode.ts +++ b/src/views/nodes/lineHistoryTrackerNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Selection, TreeItem, TreeItemCollapsibleState, window } from 'vscode'; import { UriComparer } from '../../comparers'; import { ContextKeys, setContext } from '../../constants'; diff --git a/src/views/nodes/mergeConflictCurrentChangesNode.ts b/src/views/nodes/mergeConflictCurrentChangesNode.ts index 2b61fb4..59561c3 100644 --- a/src/views/nodes/mergeConflictCurrentChangesNode.ts +++ b/src/views/nodes/mergeConflictCurrentChangesNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Command, MarkdownString, ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { Commands, DiffWithCommandArgs } from '../../commands'; import { BuiltInCommands, GlyphChars } from '../../constants'; diff --git a/src/views/nodes/mergeConflictFileNode.ts b/src/views/nodes/mergeConflictFileNode.ts index f89ac0c..97f5a9a 100644 --- a/src/views/nodes/mergeConflictFileNode.ts +++ b/src/views/nodes/mergeConflictFileNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Command, ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from 'vscode'; import { BuiltInCommands } from '../../constants'; import { StatusFileFormatter } from '../../git/formatters'; diff --git a/src/views/nodes/mergeConflictIncomingChangesNode.ts b/src/views/nodes/mergeConflictIncomingChangesNode.ts index 6e04814..83dc7dd 100644 --- a/src/views/nodes/mergeConflictIncomingChangesNode.ts +++ b/src/views/nodes/mergeConflictIncomingChangesNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Command, MarkdownString, ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { Commands, DiffWithCommandArgs } from '../../commands'; import { BuiltInCommands, GlyphChars } from '../../constants'; diff --git a/src/views/nodes/mergeStatusNode.ts b/src/views/nodes/mergeStatusNode.ts index b375cdd..e7805b6 100644 --- a/src/views/nodes/mergeStatusNode.ts +++ b/src/views/nodes/mergeStatusNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { MarkdownString, ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { ViewFilesLayout } from '../../configuration'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/pullRequestNode.ts b/src/views/nodes/pullRequestNode.ts index a99776f..93f67da 100644 --- a/src/views/nodes/pullRequestNode.ts +++ b/src/views/nodes/pullRequestNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { MarkdownString, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { GitUri } from '../../git/gitUri'; import { GitBranch, GitCommit, PullRequest, PullRequestState } from '../../git/models'; diff --git a/src/views/nodes/rebaseStatusNode.ts b/src/views/nodes/rebaseStatusNode.ts index a155706..e66ad61 100644 --- a/src/views/nodes/rebaseStatusNode.ts +++ b/src/views/nodes/rebaseStatusNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Command, commands, diff --git a/src/views/nodes/reflogNode.ts b/src/views/nodes/reflogNode.ts index f071230..cf73180 100644 --- a/src/views/nodes/reflogNode.ts +++ b/src/views/nodes/reflogNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; import { GitUri } from '../../git/gitUri'; import { GitReflog, Repository } from '../../git/models'; diff --git a/src/views/nodes/reflogRecordNode.ts b/src/views/nodes/reflogRecordNode.ts index 7038ab2..946a6a9 100644 --- a/src/views/nodes/reflogRecordNode.ts +++ b/src/views/nodes/reflogRecordNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { TreeItem, TreeItemCollapsibleState, window } from 'vscode'; import { GlyphChars } from '../../constants'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/remoteNode.ts b/src/views/nodes/remoteNode.ts index c7f98d5..5cfa853 100644 --- a/src/views/nodes/remoteNode.ts +++ b/src/views/nodes/remoteNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from 'vscode'; import { ViewBranchesLayout } from '../../configuration'; import { GlyphChars } from '../../constants'; diff --git a/src/views/nodes/remotesNode.ts b/src/views/nodes/remotesNode.ts index bcc5146..ba014df 100644 --- a/src/views/nodes/remotesNode.ts +++ b/src/views/nodes/remotesNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { GitUri } from '../../git/gitUri'; import { Repository } from '../../git/models'; diff --git a/src/views/nodes/repositoriesNode.ts b/src/views/nodes/repositoriesNode.ts index 3f60d90..cfc9e93 100644 --- a/src/views/nodes/repositoriesNode.ts +++ b/src/views/nodes/repositoriesNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, TextEditor, TreeItem, TreeItemCollapsibleState, window } from 'vscode'; import { RepositoriesChangeEvent } from '../../git/gitProviderService'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/repositoryNode.ts b/src/views/nodes/repositoryNode.ts index 855d2f9..6d98624 100644 --- a/src/views/nodes/repositoryNode.ts +++ b/src/views/nodes/repositoryNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, MarkdownString, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { GlyphChars } from '../../constants'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/resultsCommitsNode.ts b/src/views/nodes/resultsCommitsNode.ts index 597e703..27e4f48 100644 --- a/src/views/nodes/resultsCommitsNode.ts +++ b/src/views/nodes/resultsCommitsNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; import { GitUri } from '../../git/gitUri'; import { GitLog } from '../../git/models'; diff --git a/src/views/nodes/resultsFileNode.ts b/src/views/nodes/resultsFileNode.ts index ca5e3d6..872f6d2 100644 --- a/src/views/nodes/resultsFileNode.ts +++ b/src/views/nodes/resultsFileNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Command, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { Commands, DiffWithCommandArgs } from '../../commands'; import { StatusFileFormatter } from '../../git/formatters'; diff --git a/src/views/nodes/resultsFilesNode.ts b/src/views/nodes/resultsFilesNode.ts index b92ad62..25894aa 100644 --- a/src/views/nodes/resultsFilesNode.ts +++ b/src/views/nodes/resultsFilesNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { ViewFilesLayout } from '../../configuration'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/searchResultsNode.ts b/src/views/nodes/searchResultsNode.ts index fb1a0f9..7f48062 100644 --- a/src/views/nodes/searchResultsNode.ts +++ b/src/views/nodes/searchResultsNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ThemeIcon, TreeItem } from 'vscode'; import { executeGitCommand } from '../../commands'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/stashFileNode.ts b/src/views/nodes/stashFileNode.ts index 4d0e54f..81fce71 100644 --- a/src/views/nodes/stashFileNode.ts +++ b/src/views/nodes/stashFileNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitFile, GitLogCommit } from '../../git/models'; import { RepositoriesView } from '../repositoriesView'; import { StashesView } from '../stashesView'; diff --git a/src/views/nodes/stashNode.ts b/src/views/nodes/stashNode.ts index 4ec33e9..9803792 100644 --- a/src/views/nodes/stashNode.ts +++ b/src/views/nodes/stashNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; import { ViewFilesLayout } from '../../config'; import { CommitFormatter } from '../../git/formatters'; diff --git a/src/views/nodes/stashesNode.ts b/src/views/nodes/stashesNode.ts index 7b4db74..123238f 100644 --- a/src/views/nodes/stashesNode.ts +++ b/src/views/nodes/stashesNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; import { GitUri } from '../../git/gitUri'; import { Repository } from '../../git/models'; diff --git a/src/views/nodes/statusFileNode.ts b/src/views/nodes/statusFileNode.ts index 794e1ee..d9d1e92 100644 --- a/src/views/nodes/statusFileNode.ts +++ b/src/views/nodes/statusFileNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Command, ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { Commands, DiffWithCommandArgs, DiffWithPreviousCommandArgs } from '../../commands'; import { StatusFileFormatter } from '../../git/formatters/statusFormatter'; diff --git a/src/views/nodes/statusFilesNode.ts b/src/views/nodes/statusFilesNode.ts index 0841764..0fae623 100644 --- a/src/views/nodes/statusFilesNode.ts +++ b/src/views/nodes/statusFilesNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; import { ViewFilesLayout } from '../../configuration'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/tagNode.ts b/src/views/nodes/tagNode.ts index aa95fe1..bb39f84 100644 --- a/src/views/nodes/tagNode.ts +++ b/src/views/nodes/tagNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { TreeItem, TreeItemCollapsibleState, window } from 'vscode'; import { ViewBranchesLayout } from '../../configuration'; import { GlyphChars } from '../../constants'; diff --git a/src/views/nodes/tagsNode.ts b/src/views/nodes/tagsNode.ts index 95b4f8f..be838dc 100644 --- a/src/views/nodes/tagsNode.ts +++ b/src/views/nodes/tagsNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { ViewBranchesLayout } from '../../configuration'; import { GitUri } from '../../git/gitUri'; diff --git a/src/views/nodes/viewNode.ts b/src/views/nodes/viewNode.ts index 84bd5a6..0ac780f 100644 --- a/src/views/nodes/viewNode.ts +++ b/src/views/nodes/viewNode.ts @@ -1,4 +1,3 @@ -'use strict'; import { Command, Disposable, diff --git a/src/views/remotesView.ts b/src/views/remotesView.ts index 7498684..a4476db 100644 --- a/src/views/remotesView.ts +++ b/src/views/remotesView.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, commands, diff --git a/src/views/repositoriesView.ts b/src/views/repositoriesView.ts index 8d5948f..7c469c2 100644 --- a/src/views/repositoriesView.ts +++ b/src/views/repositoriesView.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, commands, diff --git a/src/views/searchAndCompareView.ts b/src/views/searchAndCompareView.ts index 9aea827..d30b815 100644 --- a/src/views/searchAndCompareView.ts +++ b/src/views/searchAndCompareView.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, ConfigurationChangeEvent, Disposable, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { getRepoPathOrPrompt } from '../commands'; import { configuration, SearchAndCompareViewConfig, ViewFilesLayout } from '../configuration'; diff --git a/src/views/stashesView.ts b/src/views/stashesView.ts index 1fd6256..ea8d3f3 100644 --- a/src/views/stashesView.ts +++ b/src/views/stashesView.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, commands, diff --git a/src/views/tagsView.ts b/src/views/tagsView.ts index b4eea60..fd0e850 100644 --- a/src/views/tagsView.ts +++ b/src/views/tagsView.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, commands, diff --git a/src/views/viewBase.ts b/src/views/viewBase.ts index dc6ece8..29f3058 100644 --- a/src/views/viewBase.ts +++ b/src/views/viewBase.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, commands, diff --git a/src/views/viewCommands.ts b/src/views/viewCommands.ts index 6b5b5e2..9bd7ba5 100644 --- a/src/views/viewCommands.ts +++ b/src/views/viewCommands.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, env, TextDocumentShowOptions, Uri, window } from 'vscode'; import type { CreatePullRequestActionContext, OpenPullRequestActionContext } from '../api/gitlens'; import { diff --git a/src/views/viewDecorationProvider.ts b/src/views/viewDecorationProvider.ts index 40fbedd..a48aabc 100644 --- a/src/views/viewDecorationProvider.ts +++ b/src/views/viewDecorationProvider.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, Disposable, diff --git a/src/vsls/guest.ts b/src/vsls/guest.ts index 23a4af7..265bf5f 100644 --- a/src/vsls/guest.ts +++ b/src/vsls/guest.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, Disposable, window, WorkspaceFolder } from 'vscode'; import type { LiveShare, SharedServiceProxy } from '../@types/vsls'; import { Container } from '../container'; diff --git a/src/vsls/host.ts b/src/vsls/host.ts index e79cd3c..c47e1ed 100644 --- a/src/vsls/host.ts +++ b/src/vsls/host.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, Disposable, Uri, workspace, WorkspaceFoldersChangeEvent } from 'vscode'; import { git } from '@env/git'; import type { LiveShare, SharedService } from '../@types/vsls'; diff --git a/src/vsls/protocol.ts b/src/vsls/protocol.ts index be97893..da9227e 100644 --- a/src/vsls/protocol.ts +++ b/src/vsls/protocol.ts @@ -1,4 +1,3 @@ -'use strict'; import { GitCommandOptions } from '../git/commandOptions'; // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/src/vsls/vsls.ts b/src/vsls/vsls.ts index d612d0e..52795f3 100644 --- a/src/vsls/vsls.ts +++ b/src/vsls/vsls.ts @@ -1,4 +1,3 @@ -'use strict'; import { Disposable, extensions, workspace } from 'vscode'; import type { LiveShare, LiveShareExtension, SessionChangeEvent } from '../@types/vsls'; import { ContextKeys, DocumentSchemes, setContext } from '../constants'; diff --git a/src/webviews/apps/rebase/rebase.ts b/src/webviews/apps/rebase/rebase.ts index d949608..7bb1dbb 100644 --- a/src/webviews/apps/rebase/rebase.ts +++ b/src/webviews/apps/rebase/rebase.ts @@ -1,4 +1,3 @@ -'use strict'; /*global document window*/ import '../scss/rebase.scss'; import Sortable from 'sortablejs'; diff --git a/src/webviews/apps/settings/settings.ts b/src/webviews/apps/settings/settings.ts index df231b2..a25a5e3 100644 --- a/src/webviews/apps/settings/settings.ts +++ b/src/webviews/apps/settings/settings.ts @@ -1,4 +1,3 @@ -'use strict'; /*global window document IntersectionObserver*/ import '../scss/settings.scss'; import { IpcMessage, onIpcNotification, SettingsDidRequestJumpToNotificationType, SettingsState } from '../../protocol'; diff --git a/src/webviews/apps/shared/appBase.ts b/src/webviews/apps/shared/appBase.ts index f3c980c..ecd3759 100644 --- a/src/webviews/apps/shared/appBase.ts +++ b/src/webviews/apps/shared/appBase.ts @@ -1,4 +1,3 @@ -'use strict'; /*global window document*/ import { IpcCommandParamsOf, IpcCommandType, IpcMessage, ReadyCommandType } from '../../protocol'; import { Disposable } from './events'; diff --git a/src/webviews/apps/shared/appWithConfigBase.ts b/src/webviews/apps/shared/appWithConfigBase.ts index bdf8b24..35f5222 100644 --- a/src/webviews/apps/shared/appWithConfigBase.ts +++ b/src/webviews/apps/shared/appWithConfigBase.ts @@ -1,4 +1,3 @@ -'use strict'; /*global document*/ import { AppStateWithConfig, diff --git a/src/webviews/apps/shared/colors.ts b/src/webviews/apps/shared/colors.ts index f0943c4..a5a6460 100644 --- a/src/webviews/apps/shared/colors.ts +++ b/src/webviews/apps/shared/colors.ts @@ -1,5 +1,3 @@ -'use strict'; - const cssColorRegex = /^(?:(#?)([0-9a-f]{3}|[0-9a-f]{6})|((?:rgb|hsl)a?)\((-?\d+%?)[,\s]+(-?\d+%?)[,\s]+(-?\d+%?)[,\s]*(-?[\d.]+%?)?\))$/i; diff --git a/src/webviews/apps/shared/date.ts b/src/webviews/apps/shared/date.ts index 8dcbab2..998bfcc 100644 --- a/src/webviews/apps/shared/date.ts +++ b/src/webviews/apps/shared/date.ts @@ -1,2 +1 @@ -'use strict'; export * from '../../../system/date'; diff --git a/src/webviews/apps/shared/dom.ts b/src/webviews/apps/shared/dom.ts index 4c56c8f..1a7a2c4 100644 --- a/src/webviews/apps/shared/dom.ts +++ b/src/webviews/apps/shared/dom.ts @@ -1,4 +1,3 @@ -'use strict'; /*global document*/ export interface Disposable { diff --git a/src/webviews/apps/shared/events.ts b/src/webviews/apps/shared/events.ts index 269032c..2ff81f1 100644 --- a/src/webviews/apps/shared/events.ts +++ b/src/webviews/apps/shared/events.ts @@ -1,5 +1,3 @@ -'use strict'; - export interface Disposable { dispose(): void; } diff --git a/src/webviews/apps/shared/snow.ts b/src/webviews/apps/shared/snow.ts index 029dcec..45e5c17 100644 --- a/src/webviews/apps/shared/snow.ts +++ b/src/webviews/apps/shared/snow.ts @@ -1,4 +1,3 @@ -'use strict'; /*global window document requestAnimationFrame*/ function randomBetween(min: number, max: number) { diff --git a/src/webviews/apps/shared/theme.ts b/src/webviews/apps/shared/theme.ts index 0989486..b1d0a43 100644 --- a/src/webviews/apps/shared/theme.ts +++ b/src/webviews/apps/shared/theme.ts @@ -1,4 +1,3 @@ -'use strict'; /*global window document MutationObserver*/ import { darken, lighten, opacity } from './colors'; diff --git a/src/webviews/apps/welcome/welcome.ts b/src/webviews/apps/welcome/welcome.ts index 0a7bdba..6d66e64 100644 --- a/src/webviews/apps/welcome/welcome.ts +++ b/src/webviews/apps/welcome/welcome.ts @@ -1,4 +1,3 @@ -'use strict'; /*global window*/ import '../scss/welcome.scss'; import { WelcomeState } from '../../protocol'; diff --git a/src/webviews/protocol.ts b/src/webviews/protocol.ts index b7b9208..c017ffa 100644 --- a/src/webviews/protocol.ts +++ b/src/webviews/protocol.ts @@ -1,4 +1,3 @@ -'use strict'; import { Config } from '../config'; export interface IpcMessage { diff --git a/src/webviews/rebaseEditor.ts b/src/webviews/rebaseEditor.ts index 1e585e6..9918d1a 100644 --- a/src/webviews/rebaseEditor.ts +++ b/src/webviews/rebaseEditor.ts @@ -1,4 +1,3 @@ -'use strict'; import { CancellationToken, commands, diff --git a/src/webviews/settingsWebview.ts b/src/webviews/settingsWebview.ts index 1f0e18c..1f27217 100644 --- a/src/webviews/settingsWebview.ts +++ b/src/webviews/settingsWebview.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, Disposable, workspace } from 'vscode'; import { Commands } from '../commands'; import { configuration } from '../configuration'; diff --git a/src/webviews/webviewBase.ts b/src/webviews/webviewBase.ts index 17d087c..10030a7 100644 --- a/src/webviews/webviewBase.ts +++ b/src/webviews/webviewBase.ts @@ -1,4 +1,3 @@ -'use strict'; import { commands, ConfigurationChangeEvent, diff --git a/src/webviews/welcomeWebview.ts b/src/webviews/welcomeWebview.ts index c171e7e..bdc4b60 100644 --- a/src/webviews/welcomeWebview.ts +++ b/src/webviews/welcomeWebview.ts @@ -1,4 +1,3 @@ -'use strict'; import { Commands } from '../commands'; import { Container } from '../container'; import { WelcomeState } from './protocol'; diff --git a/webpack.config.images.js b/webpack.config.images.js index 5084c34..2c635f7 100644 --- a/webpack.config.images.js +++ b/webpack.config.images.js @@ -1,7 +1,6 @@ //@ts-check /** @typedef {import('webpack').Configuration} WebpackConfig **/ -'use strict'; const path = require('path'); const CopyPlugin = require('copy-webpack-plugin'); const ImageMinimizerPlugin = require('image-minimizer-webpack-plugin'); diff --git a/webpack.config.js b/webpack.config.js index 0c00511..594f374 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,7 +5,6 @@ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable @typescript-eslint/strict-boolean-expressions */ /* eslint-disable @typescript-eslint/prefer-optional-chain */ -'use strict'; const { spawnSync } = require('child_process'); const path = require('path'); const CircularDependencyPlugin = require('circular-dependency-plugin'); diff --git a/webpack.config.test.js b/webpack.config.test.js index a2edfa9..de93368 100644 --- a/webpack.config.test.js +++ b/webpack.config.test.js @@ -1,5 +1,3 @@ -'use strict'; - //@ts-check /** @typedef {import('webpack').Configuration} WebpackConfig **/