1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Chore: Add eslint rule to enforce strict equality (eqeqeq)

This commit is contained in:
Laurent Cozic
2022-07-23 09:31:32 +02:00
parent 8a8def39f0
commit 052d9f03d6
62 changed files with 496 additions and 497 deletions

View File

@ -300,7 +300,7 @@ export default class Note extends BaseItem {
if (aProp < bProp) r = +1;
if (aProp > bProp) r = -1;
}
if (order.dir == 'ASC') r = -r;
if (order.dir === 'ASC') r = -r;
if (r !== 0) return r;
}
@ -365,7 +365,7 @@ export default class Note extends BaseItem {
// it's confusing to have conflicts but with an empty conflict folder.
if (parentId === Folder.conflictFolderId()) options.showCompletedTodos = true;
if (parentId == Folder.conflictFolderId()) {
if (parentId === Folder.conflictFolderId()) {
options.conditions.push('is_conflict = 1');
} else {
options.conditions.push('is_conflict = 0');
@ -527,7 +527,7 @@ export default class Note extends BaseItem {
}
static async copyToFolder(noteId: string, folderId: string) {
if (folderId == this.getClass('Folder').conflictFolderId()) throw new Error(_('Cannot copy note to "%s" notebook', this.getClass('Folder').conflictFolderTitle()));
if (folderId === this.getClass('Folder').conflictFolderId()) throw new Error(_('Cannot copy note to "%s" notebook', this.getClass('Folder').conflictFolderTitle()));
return Note.duplicate(noteId, {
changes: {
@ -539,7 +539,7 @@ export default class Note extends BaseItem {
}
static async moveToFolder(noteId: string, folderId: string) {
if (folderId == this.getClass('Folder').conflictFolderId()) throw new Error(_('Cannot move note to "%s" notebook', this.getClass('Folder').conflictFolderTitle()));
if (folderId === this.getClass('Folder').conflictFolderId()) throw new Error(_('Cannot move note to "%s" notebook', this.getClass('Folder').conflictFolderTitle()));
// When moving a note to a different folder, the user timestamp is not updated.
// However updated_time is updated so that the note can be synced later on.