1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-05 22:57:29 +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

@@ -23,7 +23,7 @@ function dateToTimestamp(s, zeroIfInvalid = false) {
if (!m.isValid()) {
if (zeroIfInvalid) return 0;
throw new Error('Invalid date: ' + s);
throw new Error(`Invalid date: ${s}`);
}
return m.toDate().getTime();
@@ -294,7 +294,7 @@ function importEnex(parentFolderId, filePath, importOptions = null) {
} else if (n == 'content') {
// Ignore - white space between the opening tag <content> and the <![CDATA[< block where the content actually is
} else {
console.warn('Unsupported note tag: ' + n);
console.warn(`Unsupported note tag: ${n}`);
}
}
});
@@ -368,7 +368,7 @@ function importEnex(parentFolderId, filePath, importOptions = null) {
note.todo_due = dateToTimestamp(noteAttributes['reminder-time'], true);
note.todo_completed = dateToTimestamp(noteAttributes['reminder-done-time'], true);
note.order = dateToTimestamp(noteAttributes['reminder-order'], true);
note.source = noteAttributes.source ? 'evernote.' + noteAttributes.source : 'evernote';
note.source = noteAttributes.source ? `evernote.${noteAttributes.source}` : 'evernote';
note.source_url = noteAttributes['source-url'] ? noteAttributes['source-url'] : '';
// if (noteAttributes['reminder-time']) {
@@ -390,7 +390,7 @@ function importEnex(parentFolderId, filePath, importOptions = null) {
importOptions.onError(error);
}
} else if (noteResource.dataEncoding) {
importOptions.onError(new Error('Cannot decode resource with encoding: ' + noteResource.dataEncoding));
importOptions.onError(new Error(`Cannot decode resource with encoding: ${noteResource.dataEncoding}`));
decodedData = noteResource.data; // Just put the encoded data directly in the file so it can, potentially, be manually decoded later
}
@@ -402,8 +402,8 @@ function importEnex(parentFolderId, filePath, importOptions = null) {
if (!resourceId || !noteResource.data) {
const debugTemp = Object.assign({}, noteResource);
debugTemp.data = debugTemp.data ? debugTemp.data.substr(0, 32) + '...' : debugTemp.data;
importOptions.onError(new Error('This resource was not added because it has no ID or no content: ' + JSON.stringify(debugTemp)));
debugTemp.data = debugTemp.data ? `${debugTemp.data.substr(0, 32)}...` : debugTemp.data;
importOptions.onError(new Error(`This resource was not added because it has no ID or no content: ${JSON.stringify(debugTemp)}`));
} else {
let size = 0;
if (decodedData) {