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

Tools: Implement "prefer-object-spread" eslint rule

This commit is contained in:
Laurent Cozic
2023-06-01 12:02:36 +01:00
parent 804d674d37
commit c89edd7b22
126 changed files with 588 additions and 909 deletions

View File

@ -260,7 +260,7 @@ const settingFilename = (id: number): string => {
};
async function switchClient(id: number, options: any = null) {
options = Object.assign({}, { keychainEnabled: false }, options);
options = { keychainEnabled: false, ...options };
if (!databases_[id]) throw new Error(`Call setupDatabaseAndSynchronizer(${id}) first!!`);
@ -326,7 +326,7 @@ async function clearDatabase(id: number = null) {
}
async function setupDatabase(id: number = null, options: any = null) {
options = Object.assign({}, { keychainEnabled: false }, options);
options = { keychainEnabled: false, ...options };
if (id === null) id = currentClient_;
@ -483,7 +483,7 @@ async function synchronizerStart(id: number = null, extraOptions: any = null) {
const contextString = Setting.value(contextKey);
const context = contextString ? JSON.parse(contextString) : {};
const options = Object.assign({}, extraOptions);
const options = { ...extraOptions };
if (context) options.context = context;
const newContext = await synchronizer(id).start(options);