Skip to content

Commit

Permalink
Fixing NPM lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian <[email protected]>
  • Loading branch information
SebieF committed Sep 13, 2024
1 parent 6d129a4 commit 93f1f60
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/store/storeHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,22 +427,21 @@ function sortByDate(taskA, taskB, date) {
* @return {number}
*/
function sortByTags(taskA, taskB) {
const tagsA = taskA.tags.sort();
const tagsB = taskB.tags.sort();
const tagsA = taskA.tags.sort()
const tagsB = taskB.tags.sort()

// Compare each tag in order
for (let i = 0; i < Math.min(tagsA.length, tagsB.length); i++) {
const comparison = tagsA[i].toLowerCase().localeCompare(tagsB[i].toLowerCase());
const comparison = tagsA[i].toLowerCase().localeCompare(tagsB[i].toLowerCase())
if (comparison !== 0) {
return comparison;
return comparison
}
}

// If all compared tags are equal, shorter tag list comes first
return tagsA.length - tagsB.length;
return tagsA.length - tagsB.length
}


/**
* Comparator to compare two tasks by sort order in ascending order
*
Expand Down

0 comments on commit 93f1f60

Please sign in to comment.