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

@@ -552,7 +552,7 @@ export default class Folder extends BaseItem {
for (let i = 0; i < length; i++) {
const model = models[i];
if (model.parent_id == parentId) {
if (model.parent_id === parentId) {
const children = getNestedChildren(models, model.id);
if (children.length > 0) {
@@ -666,7 +666,7 @@ export default class Folder extends BaseItem {
}
static load(id: string, _options: any = null): Promise<FolderEntity> {
if (id == this.conflictFolderId()) return Promise.resolve(this.conflictFolder());
if (id === this.conflictFolderId()) return Promise.resolve(this.conflictFolder());
return super.load(id);
}
@@ -681,7 +681,7 @@ export default class Folder extends BaseItem {
if (isRootSharedFolder(folder)) return false;
const conflictFolderId = Folder.conflictFolderId();
if (folderId == conflictFolderId || targetFolderId == conflictFolderId) return false;
if (folderId === conflictFolderId || targetFolderId === conflictFolderId) return false;
if (!targetFolderId) return true;
@@ -728,7 +728,7 @@ export default class Folder extends BaseItem {
}
if (options.stripLeftSlashes === true && o.title) {
while (o.title.length && (o.title[0] == '/' || o.title[0] == '\\')) {
while (o.title.length && (o.title[0] === '/' || o.title[0] === '\\')) {
o.title = o.title.substr(1);
}
}
@@ -748,7 +748,7 @@ export default class Folder extends BaseItem {
// }
if (options.reservedTitleCheck === true && o.title) {
if (o.title == Folder.conflictFolderTitle()) throw new Error(_('Notebooks cannot be named "%s", which is a reserved title.', o.title));
if (o.title === Folder.conflictFolderTitle()) throw new Error(_('Notebooks cannot be named "%s", which is a reserved title.', o.title));
}
syncDebugLog.info('Folder Save:', o);