Browse Source

Fixes lint issues

main
Eric Amodio 4 years ago
parent
commit
4d3a433430
10 changed files with 14 additions and 19 deletions
  1. +1
    -1
      src/annotations/autolinks.ts
  2. +1
    -1
      src/annotations/fileAnnotationController.ts
  3. +1
    -1
      src/codelens/codeLensProvider.ts
  4. +1
    -1
      src/git/formatters/commitFormatter.ts
  5. +1
    -1
      src/trackers/documentTracker.ts
  6. +1
    -1
      src/trackers/trackedDocument.ts
  7. +1
    -1
      src/views/viewBase.ts
  8. +3
    -8
      src/vsls/vsls.ts
  9. +2
    -2
      src/webviews/apps/shared/events.ts
  10. +2
    -2
      src/webviews/webviewBase.ts

+ 1
- 1
src/annotations/autolinks.ts View File

@ -40,7 +40,7 @@ export class Autolinks implements Disposable {
} }
dispose() { dispose() {
this._disposable && this._disposable.dispose();
this._disposable?.dispose();
} }
private onConfigurationChanged(e: ConfigurationChangeEvent) { private onConfigurationChanged(e: ConfigurationChangeEvent) {

+ 1
- 1
src/annotations/fileAnnotationController.ts View File

@ -454,7 +454,7 @@ export class FileAnnotationController implements Disposable {
if (this._annotationProviders.size === 0) { if (this._annotationProviders.size === 0) {
Logger.log('Remove all listener registrations for annotations'); Logger.log('Remove all listener registrations for annotations');
this._annotationsDisposable && this._annotationsDisposable.dispose();
this._annotationsDisposable?.dispose();
this._annotationsDisposable = undefined; this._annotationsDisposable = undefined;
} }

+ 1
- 1
src/codelens/codeLensProvider.ts View File

@ -57,7 +57,7 @@ export class GitRecentChangeCodeLens extends CodeLens {
} }
getBlame(): GitBlameLines | undefined { getBlame(): GitBlameLines | undefined {
return this.blame && this.blame();
return this.blame?.();
} }
} }

+ 1
- 1
src/git/formatters/commitFormatter.ts View File

@ -414,7 +414,7 @@ export class CommitFormatter extends Formatter {
} }
get tips() { get tips() {
const branchAndTagTips = this._options.getBranchAndTagTips && this._options.getBranchAndTagTips(this._item.sha);
const branchAndTagTips = this._options.getBranchAndTagTips?.(this._item.sha);
if (branchAndTagTips == null) return emptyStr; if (branchAndTagTips == null) return emptyStr;
return this._padOrTruncate(branchAndTagTips, this._options.tokenOptions.tips); return this._padOrTruncate(branchAndTagTips, this._options.tokenOptions.tips);

+ 1
- 1
src/trackers/documentTracker.ts View File

@ -80,7 +80,7 @@ export class DocumentTracker implements Disposable {
} }
dispose() { dispose() {
this._disposable && this._disposable.dispose();
this._disposable?.dispose();
this.clear(); this.clear();
} }

+ 1
- 1
src/trackers/trackedDocument.ts View File

@ -38,7 +38,7 @@ export class TrackedDocument implements Disposable {
dispose() { dispose() {
this._disposed = true; this._disposed = true;
this.reset('dispose'); this.reset('dispose');
this._disposable && this._disposable.dispose();
this._disposable?.dispose();
} }
private async initialize(uri: Uri): Promise<Repository | undefined> { private async initialize(uri: Uri): Promise<Repository | undefined> {

+ 1
- 1
src/views/viewBase.ts View File

@ -82,7 +82,7 @@ export abstract class ViewBase> implements TreeData
} }
dispose() { dispose() {
this._disposable && this._disposable.dispose();
this._disposable?.dispose();
} }
getQualifiedCommand(command: string) { getQualifiedCommand(command: string) {

+ 3
- 8
src/vsls/vsls.ts View File

@ -47,14 +47,9 @@ export class VslsController implements Disposable {
} }
dispose() { dispose() {
this._disposable && this._disposable.dispose();
if (this._host !== undefined) {
this._host.dispose();
}
if (this._guest !== undefined) {
this._guest.dispose();
}
this._disposable?.dispose();
this._host?.dispose();
this._guest?.dispose();
} }
private async initialize() { private async initialize() {

+ 2
- 2
src/webviews/apps/shared/events.ts View File

@ -58,7 +58,7 @@ export class Emitter {
this._options.onFirstListenerDidAdd(this); this._options.onFirstListenerDidAdd(this);
} }
if (this._options && this._options.onListenerDidAdd) {
if (this._options?.onListenerDidAdd) {
this._options.onListenerDidAdd(this, listener, thisArgs); this._options.onListenerDidAdd(this, listener, thisArgs);
} }
@ -67,7 +67,7 @@ export class Emitter {
result.dispose = Emitter._noop; result.dispose = Emitter._noop;
if (!this._disposed) { if (!this._disposed) {
remove(); remove();
if (this._options && this._options.onLastListenerRemove) {
if (this._options?.onLastListenerRemove) {
const hasListeners = this._listeners && !this._listeners.isEmpty(); const hasListeners = this._listeners && !this._listeners.isEmpty();
if (!hasListeners) { if (!hasListeners) {
this._options.onLastListenerRemove(this); this._options.onLastListenerRemove(this);

+ 2
- 2
src/webviews/webviewBase.ts View File

@ -63,7 +63,7 @@ export abstract class WebviewBase implements Disposable {
dispose() { dispose() {
this.disposable.dispose(); this.disposable.dispose();
this._disposablePanel && this._disposablePanel.dispose();
this._disposablePanel?.dispose();
} }
protected onShowCommand() { protected onShowCommand() {
@ -75,7 +75,7 @@ export abstract class WebviewBase implements Disposable {
} }
private onPanelDisposed() { private onPanelDisposed() {
this._disposablePanel && this._disposablePanel.dispose();
this._disposablePanel?.dispose();
this._panel = undefined; this._panel = undefined;
} }

Loading…
Cancel
Save