Fix some typescript checks
* Do not use trailing or leading underscores for private properties * Expression evaluates to `void`, but it's used as a value * Prefer using 'new' instead of relying on implicit construction Change-Id: I290ed8689549e0099df91a62d40cf2b2cce6a105
This commit is contained in:
@@ -79,7 +79,7 @@ export class GrDiffCursor extends GestureEventListeners(
|
||||
|
||||
private _preventAutoScrollOnManualScroll = false;
|
||||
|
||||
private _lastDisplayedNavigateToNextFileToast: number | null = null;
|
||||
private lastDisplayedNavigateToNextFileToast: number | null = null;
|
||||
|
||||
@property({type: String})
|
||||
side = Side.RIGHT;
|
||||
@@ -222,12 +222,12 @@ export class GrDiffCursor extends GestureEventListeners(
|
||||
this.$.cursorManager.isAtEnd()
|
||||
) {
|
||||
if (
|
||||
this._lastDisplayedNavigateToNextFileToast &&
|
||||
Date.now() - this._lastDisplayedNavigateToNextFileToast <=
|
||||
this.lastDisplayedNavigateToNextFileToast &&
|
||||
Date.now() - this.lastDisplayedNavigateToNextFileToast <=
|
||||
NAVIGATE_TO_NEXT_FILE_TIMEOUT_MS
|
||||
) {
|
||||
// reset for next file
|
||||
this._lastDisplayedNavigateToNextFileToast = null;
|
||||
this.lastDisplayedNavigateToNextFileToast = null;
|
||||
this.dispatchEvent(
|
||||
new CustomEvent('navigate-to-next-unreviewed-file', {
|
||||
composed: true,
|
||||
@@ -235,7 +235,7 @@ export class GrDiffCursor extends GestureEventListeners(
|
||||
})
|
||||
);
|
||||
}
|
||||
this._lastDisplayedNavigateToNextFileToast = Date.now();
|
||||
this.lastDisplayedNavigateToNextFileToast = Date.now();
|
||||
this.dispatchEvent(
|
||||
new CustomEvent('show-alert', {
|
||||
detail: {
|
||||
|
@@ -554,7 +554,7 @@ export class GrCommentThread extends KeyboardShortcutMixin(
|
||||
const comment = diffCommentEl.comment;
|
||||
const idx = this._indexOf(comment, this.comments);
|
||||
if (idx === -1) {
|
||||
throw Error(
|
||||
throw new Error(
|
||||
'Cannot find comment ' + JSON.stringify(diffCommentEl.comment)
|
||||
);
|
||||
}
|
||||
@@ -574,7 +574,7 @@ export class GrCommentThread extends KeyboardShortcutMixin(
|
||||
path: changeComment.path,
|
||||
line: changeComment.line,
|
||||
};
|
||||
return this.$.storage.setDraftComment(
|
||||
this.$.storage.setDraftComment(
|
||||
commentLocation,
|
||||
changeComment.message ?? ''
|
||||
);
|
||||
|
Reference in New Issue
Block a user