You've already forked joplin
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user