Eslintify all of libtextsecure

This commit is contained in:
Scott Nonnenberg 2018-07-21 14:51:20 -07:00
parent 4b3f9e969a
commit 0774ba2903
36 changed files with 1960 additions and 2128 deletions

View file

@ -1,35 +1,31 @@
/* global window, dcodeIO, textsecure */
// eslint-disable-next-line func-names
(function() {
'use strict';
window.textsecure = window.textsecure || {};
window.textsecure.protobuf = {};
function loadProtoBufs(filename) {
return dcodeIO.ProtoBuf.loadProtoFile(
{ root: window.PROTO_ROOT, file: filename },
function(error, result) {
(error, result) => {
if (error) {
var text =
'Error loading protos from ' +
filename +
' (root: ' +
window.PROTO_ROOT +
') ' +
(error && error.stack ? error.stack : error);
const text = `Error loading protos from ${filename} (root: ${
window.PROTO_ROOT
}) ${error && error.stack ? error.stack : error}`;
window.log.error(text);
throw error;
}
var protos = result.build('signalservice');
const protos = result.build('signalservice');
if (!protos) {
var text =
'Error loading protos from ' +
filename +
' (root: ' +
window.PROTO_ROOT +
')';
const text = `Error loading protos from ${filename} (root: ${
window.PROTO_ROOT
})`;
window.log.error(text);
throw new Error(text);
}
for (var protoName in protos) {
// eslint-disable-next-line no-restricted-syntax, guard-for-in
for (const protoName in protos) {
textsecure.protobuf[protoName] = protos[protoName];
}
}