1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Chore: Apply eslint rules

This commit is contained in:
Laurent Cozic
2019-09-19 22:51:18 +01:00
parent ab29d7e872
commit e648392330
185 changed files with 1196 additions and 1196 deletions

View File

@ -102,13 +102,13 @@ class Synchronizer {
if (local) {
let s = [];
s.push(local.id);
line.push('(Local ' + s.join(', ') + ')');
line.push(`(Local ${s.join(', ')})`);
}
if (remote) {
let s = [];
s.push(remote.id ? remote.id : remote.path);
line.push('(Remote ' + s.join(', ') + ')');
line.push(`(Remote ${s.join(', ')})`);
}
this.logger().debug(line.join(': '));
@ -130,14 +130,14 @@ class Synchronizer {
if (n == 'finished') continue;
if (n == 'state') continue;
if (n == 'completedTime') continue;
this.logger().info(n + ': ' + (report[n] ? report[n] : '-'));
this.logger().info(`${n}: ${report[n] ? report[n] : '-'}`);
}
let folderCount = await Folder.count();
let noteCount = await Note.count();
let resourceCount = await Resource.count();
this.logger().info('Total folders: ' + folderCount);
this.logger().info('Total notes: ' + noteCount);
this.logger().info('Total resources: ' + resourceCount);
this.logger().info(`Total folders: ${folderCount}`);
this.logger().info(`Total notes: ${noteCount}`);
this.logger().info(`Total resources: ${resourceCount}`);
if (report.errors && report.errors.length) {
this.logger().warn('There was some errors:');
@ -214,7 +214,7 @@ class Synchronizer {
this.dispatch({ type: 'SYNC_STARTED' });
this.logSyncOperation('starting', null, null, 'Starting synchronisation to target ' + syncTargetId + '... [' + synchronizationId + ']');
this.logSyncOperation('starting', null, null, `Starting synchronisation to target ${syncTargetId}... [${synchronizationId}]`);
const handleCannotSyncItem = async (ItemClass, syncTargetId, item, cannotSyncReason, itemLocation = null) => {
await ItemClass.saveSyncDisabled(syncTargetId, item, cannotSyncReason, itemLocation);
@ -222,7 +222,7 @@ class Synchronizer {
};
const resourceRemotePath = resourceId => {
return this.resourceDirName_ + '/' + resourceId;
return `${this.resourceDirName_}/${resourceId}`;
};
try {
@ -302,14 +302,14 @@ class Synchronizer {
} catch (error) {
if (error.code === 'rejectedByTarget') {
this.progressReport_.errors.push(error);
this.logger().warn('Rejected by target: ' + path + ': ' + error.message);
this.logger().warn(`Rejected by target: ${path}: ${error.message}`);
completeItemProcessing(path);
continue;
} else {
throw error;
}
}
if (!remoteContent) throw new Error('Got metadata for path but could not fetch content: ' + path);
if (!remoteContent) throw new Error(`Got metadata for path but could not fetch content: ${path}`);
remoteContent = await BaseItem.unserialize(remoteContent);
if (remoteContent.updated_time > local.sync_time) {
@ -572,10 +572,10 @@ class Synchronizer {
} catch (error) {
if (error.code === 'rejectedByTarget') {
this.progressReport_.errors.push(error);
this.logger().warn('Rejected by target: ' + path + ': ' + error.message);
this.logger().warn(`Rejected by target: ${path}: ${error.message}`);
action = null;
} else {
error.message = 'On file ' + path + ': ' + error.message;
error.message = `On file ${path}: ${error.message}`;
throw error;
}
}
@ -588,7 +588,7 @@ class Synchronizer {
if (action == 'createLocal' || action == 'updateLocal') {
if (content === null) {
this.logger().warn('Remote has been deleted between now and the delta() call? In that case it will be handled during the next sync: ' + path);
this.logger().warn(`Remote has been deleted between now and the delta() call? In that case it will be handled during the next sync: ${path}`);
continue;
}
content = ItemClass.filter(content);
@ -613,7 +613,7 @@ class Synchronizer {
if (creatingNewResource) {
if (content.size >= this.maxResourceSize()) {
await handleCannotSyncItem(ItemClass, syncTargetId, content, 'File "' + content.title + '" is larger than allowed ' + this.maxResourceSize() + ' bytes. Beyond this limit, the mobile app would crash.', BaseItem.SYNC_ITEM_LOCATION_REMOTE);
await handleCannotSyncItem(ItemClass, syncTargetId, content, `File "${content.title}" is larger than allowed ${this.maxResourceSize()} bytes. Beyond this limit, the mobile app would crash.`, BaseItem.SYNC_ITEM_LOCATION_REMOTE);
continue;
}
@ -718,7 +718,7 @@ class Synchronizer {
this.progressReport_.completedTime = time.unixMs();
this.logSyncOperation('finished', null, null, 'Synchronisation finished [' + synchronizationId + ']');
this.logSyncOperation('finished', null, null, `Synchronisation finished [${synchronizationId}]`);
await this.logSyncSummary(this.progressReport_);