Update TypeScript, Prettier and typescript-eslint for new TypeScript 3.8 syntax

This commit is contained in:
Scott Nonnenberg 2020-11-18 07:15:42 -08:00 committed by Josh Perez
parent 5758ed44ac
commit 26884432a2
65 changed files with 286 additions and 185 deletions

View file

@ -6,7 +6,7 @@
/* eslint-disable more/no-then */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
function resolveTheme() {

View file

@ -4,7 +4,7 @@
/* global Whisper */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.BannerView = Whisper.View.extend({

View file

@ -7,7 +7,7 @@
/* eslint-disable no-new */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
const { Logs } = window.Signal;

View file

@ -4,7 +4,7 @@
/* global Backbone, Whisper, i18n */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.ConfirmationDialogView = Whisper.View.extend({

View file

@ -5,7 +5,7 @@
/* global textsecure: false */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.ContactListView = Whisper.ListView.extend({

View file

@ -5,7 +5,7 @@
/* global Whisper: false */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.LinkedCopiedToast = Whisper.ToastView.extend({
@ -80,9 +80,7 @@
});
this.$('.loading').removeClass('loading');
view.render();
this.$('.link')
.focus()
.select();
this.$('.link').focus().select();
} catch (error) {
window.log.error(
'DebugLogView error:',

View file

@ -4,7 +4,7 @@
/* global Whisper, i18n */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
// TODO: take a title string which could replace the 'members' header

View file

@ -4,7 +4,7 @@
/* global Whisper, loadImage */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
/*

View file

@ -9,7 +9,7 @@
*/
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.StickerPackInstallFailedToast = Whisper.ToastView.extend({

View file

@ -6,7 +6,7 @@
/* eslint-disable more/no-then */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
const Steps = {

View file

@ -6,7 +6,7 @@
/* eslint-disable more/no-then */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.KeyVerificationPanelView = Whisper.View.extend({

View file

@ -4,7 +4,7 @@
/* global Backbone, Whisper, _ */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
/*

View file

@ -4,7 +4,7 @@
/* global libphonenumber, Whisper */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.PhoneInputView = Whisper.View.extend({

View file

@ -7,7 +7,7 @@
/* global ReactDOM: false */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
window.Whisper.ReactWrapperView = Backbone.View.extend({

View file

@ -6,7 +6,7 @@
/* eslint-disable more/no-then */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.RecorderView = Whisper.View.extend({

View file

@ -4,7 +4,7 @@
/* global Whisper, Signal */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.SafetyNumberChangeDialogView = Whisper.View.extend({

View file

@ -8,7 +8,7 @@
/* eslint-disable no-new */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
const { Settings } = window.Signal.Types;

View file

@ -6,7 +6,7 @@
/* eslint-disable more/no-then */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.StandaloneRegistrationView = Whisper.View.extend({
@ -37,9 +37,7 @@
},
verifyCode() {
const number = this.phoneView.validateNumber();
const verificationCode = $('#code')
.val()
.replace(/\D+/g, '');
const verificationCode = $('#code').val().replace(/\D+/g, '');
this.accountManager
.registerSingleDevice(number, verificationCode)
@ -53,9 +51,7 @@
this.$('#status').text(s);
},
validateCode() {
const verificationCode = $('#code')
.val()
.replace(/\D/g, '');
const verificationCode = $('#code').val().replace(/\D/g, '');
if (verificationCode.length === 6) {
return verificationCode;
@ -64,11 +60,7 @@
return null;
},
displayError(error) {
this.$('#error')
.hide()
.text(error)
.addClass('in')
.fadeIn();
this.$('#error').hide().text(error).addClass('in').fadeIn();
},
onValidation() {
if (this.$('#number-container').hasClass('valid')) {
@ -92,9 +84,7 @@
this.accountManager
.requestVoiceVerification(number)
.catch(this.displayError.bind(this));
this.$('#step2')
.addClass('in')
.fadeIn();
this.$('#step2').addClass('in').fadeIn();
} else {
this.$('#number-container').addClass('invalid');
}
@ -107,9 +97,7 @@
this.accountManager
.requestSMSVerification(number)
.catch(this.displayError.bind(this));
this.$('#step2')
.addClass('in')
.fadeIn();
this.$('#step2').addClass('in').fadeIn();
} else {
this.$('#number-container').addClass('invalid');
}

View file

@ -4,7 +4,7 @@
/* global Whisper, Mustache, _ */
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.ToastView = Whisper.View.extend({

View file

@ -24,7 +24,7 @@
*/
// eslint-disable-next-line func-names
(function() {
(function () {
window.Whisper = window.Whisper || {};
Whisper.View = Backbone.View.extend(