1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-18 23:07:45 +02:00

Tools: Enforce and apply eslint rules prefer-const and no-var

This commit is contained in:
Laurent Cozic
2020-03-13 23:46:14 +00:00
parent 92bee549a1
commit d0d2bad7f4
189 changed files with 1387 additions and 1377 deletions

View File

@ -116,7 +116,7 @@ class FileApi {
}
fullPath_(path) {
let output = [];
const output = [];
if (this.baseDir()) output.push(this.baseDir());
if (path) output.push(path);
return output.join('/');
@ -134,7 +134,7 @@ class FileApi {
const result = await tryAndRepeat(() => this.driver_.list(this.fullPath_(path), options), this.requestRepeatCount());
if (!options.includeHidden) {
let temp = [];
const temp = [];
for (let i = 0; i < result.items.length; i++) {
if (!isHidden(result.items[i].path)) temp.push(result.items[i]);
}
@ -216,7 +216,7 @@ class FileApi {
}
function basicDeltaContextFromOptions_(options) {
let output = {
const output = {
timestamp: 0,
filesAtTimestamp: [],
statsCache: null,
@ -254,7 +254,7 @@ async function basicDelta(path, getDirStatFn, options) {
logger.warn('BasicDelta: Sync will continue but it is likely that nothing will be synced');
}
let newContext = {
const newContext = {
timestamp: context.timestamp,
filesAtTimestamp: context.filesAtTimestamp.slice(),
statsCache: context.statsCache,
@ -327,7 +327,7 @@ async function basicDelta(path, getDirStatFn, options) {
// we have to the items on the target.
// Note that when deleted items are processed it might result in the output having
// more items than outputLimit. This is acceptable since delete operations are cheap.
let deletedItems = [];
const deletedItems = [];
for (let i = 0; i < itemIds.length; i++) {
const itemId = itemIds[i];