Fix the linting errors

This commit is contained in:
David Baker 2019-12-10 18:10:15 +00:00
parent a13c0e0be5
commit 14a919cf9b
3 changed files with 23 additions and 16 deletions

View file

@ -17,3 +17,9 @@ module.exports = {
// don't use babel, so remove it & put the original back
delete module.exports.rules["babel/no-invalid-this"];
module.exports.rules["no-invalid-this"] = "error";
// also override the line length to be consistent with
// vector-web / react-sdk rather than js-sdk
module.exports.rules["max-len"] = ["warn", {
code: 120,
}];

View file

@ -301,14 +301,14 @@ ipcMain.on('seshat', async function(ev, payload) {
const sendError = (id, e) => {
const error = {
message: e.message
}
message: e.message,
};
mainWindow.webContents.send('seshatReply', {
id:id,
error: error
id: id,
error: error,
});
}
};
const args = payload.args || [];
let ret;
@ -336,16 +336,18 @@ ipcMain.on('seshat', async function(ev, payload) {
break;
case 'deleteEventIndex':
const deleteFolderRecursive = async(p) => {
for (let entry of await afs.readdir(p)) {
const curPath = path.join(p, entry);
await afs.unlink(curPath);
}
}
{
const deleteFolderRecursive = async (p) => {
for (const entry of await afs.readdir(p)) {
const curPath = path.join(p, entry);
await afs.unlink(curPath);
}
};
try {
await deleteFolderRecursive(eventStorePath);
} catch (e) {
try {
await deleteFolderRecursive(eventStorePath);
} catch (e) {
}
}
break;

View file

@ -38,7 +38,6 @@ module.exports.start = function startAutoUpdate(updateBaseUrl) {
// and also acts as a convenient cache-buster to ensure that when the
// app updates it always gets a fresh value to avoid update-looping.
url = `${updateBaseUrl}macos/?localVersion=${encodeURIComponent(app.getVersion())}`;
} else if (process.platform === 'win32') {
url = `${updateBaseUrl}win32/${process.arch}/`;
} else {
@ -64,7 +63,7 @@ module.exports.start = function startAutoUpdate(updateBaseUrl) {
// will fail if running in debug mode
console.log('Couldn\'t enable update checking', err);
}
}
};
ipcMain.on('install_update', installUpdate);
ipcMain.on('check_updates', pollForUpdates);