You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-10 00:05:42 +02:00
Tools: Add eslint rule prefer-await-to-then
This commit is contained in:
@ -77,6 +77,7 @@ export default async function populateDatabase(db: any, options: Options = null)
|
||||
let tagBatch = [];
|
||||
for (let i = 0; i < options.tagCount; i++) {
|
||||
const tagTitle = randomElement(wordList); // `tag${i}`
|
||||
// eslint-disable-next-line promise/prefer-await-to-then -- Old code before rule was applied
|
||||
tagBatch.push(Tag.save({ title: tagTitle }, { dispatchUpdateAction: false }).then((savedTag: any) => {
|
||||
createdTagIds.push(savedTag.id);
|
||||
if (!options.silent) console.info(`Tags: ${i} / ${options.tagCount}`);
|
||||
@ -99,6 +100,7 @@ export default async function populateDatabase(db: any, options: Options = null)
|
||||
const parentIndex = randomIndex(createdFolderIds);
|
||||
note.parent_id = createdFolderIds[parentIndex];
|
||||
|
||||
// eslint-disable-next-line promise/prefer-await-to-then -- Old code before rule was applied
|
||||
noteBatch.push(Note.save(note, { dispatchUpdateAction: false }).then((savedNote: any) => {
|
||||
createdNoteIds.push(savedNote.id);
|
||||
console.info(`Notes: ${i} / ${options.noteCount}`);
|
||||
|
Reference in New Issue
Block a user