1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-24 23:26:50 +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

@ -111,13 +111,13 @@ class BaseApplication {
// Handles the initial flags passed to main script and
// returns the remaining args.
async handleStartFlags_(argv, setDefaults = true) {
let matched = {};
const matched = {};
argv = argv.slice(0);
argv.splice(0, 2); // First arguments are the node executable, and the node JS file
while (argv.length) {
let arg = argv[0];
let nextArg = argv.length >= 2 ? argv[1] : null;
const arg = argv[0];
const nextArg = argv.length >= 2 ? argv[1] : null;
if (arg == '--profile') {
if (!nextArg) throw new JoplinError(_('Usage: %s', '--profile <dir-path>'), 'flagError');
@ -245,7 +245,7 @@ class BaseApplication {
this.logger().debug('Refreshing notes:', parentType, parentId);
let options = {
const options = {
order: stateUtils.notesOrder(state.settings),
uncompletedTodosOnTop: Setting.value('uncompletedTodosOnTop'),
showCompletedTodos: Setting.value('showCompletedTodos'),
@ -333,7 +333,7 @@ class BaseApplication {
}
reducerActionToString(action) {
let o = [action.type];
const o = [action.type];
if ('id' in action) o.push(action.id);
if ('noteId' in action) o.push(action.noteId);
if ('folderId' in action) o.push(action.folderId);
@ -580,7 +580,7 @@ class BaseApplication {
}
async start(argv) {
let startFlags = await this.handleStartFlags_(argv);
const startFlags = await this.handleStartFlags_(argv);
argv = startFlags.argv;
let initArgs = startFlags.matched;
@ -712,7 +712,7 @@ class BaseApplication {
SearchEngine.instance().setLogger(reg.logger());
SearchEngine.instance().scheduleSyncTables();
let currentFolderId = Setting.value('activeFolderId');
const currentFolderId = Setting.value('activeFolderId');
let currentFolder = null;
if (currentFolderId) currentFolder = await Folder.load(currentFolderId);
if (!currentFolder) currentFolder = await Folder.defaultFolder();