From 4b1b1d2860c466e8a9094e7876f319658f5acac7 Mon Sep 17 00:00:00 2001
From: Mara-Li
Date: Sat, 28 Dec 2024 18:25:33 +0100
Subject: [PATCH] style(lint): biome format with 1.9.4
---
src/@types/ExcalidrawAutomate.d.ts | 4 ++--
src/GitHub/files.ts | 6 ++++--
src/conversion/compiler/excalidraw.ts | 2 +-
src/conversion/file_path.ts | 4 ++--
src/conversion/links.ts | 6 +++---
src/interfaces/main.ts | 4 ++--
src/settings.ts | 18 +++++++++---------
src/settings/help.ts | 2 +-
src/settings/migrate.ts | 2 +-
src/settings/modals/list_changed.ts | 8 ++++----
src/settings/modals/manage_repo.ts | 4 ++--
src/settings/style.ts | 2 +-
src/styles.css | 4 +---
src/utils/parse_frontmatter.ts | 10 +++++-----
14 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/src/@types/ExcalidrawAutomate.d.ts b/src/@types/ExcalidrawAutomate.d.ts
index 57333d1c..d464926d 100644
--- a/src/@types/ExcalidrawAutomate.d.ts
+++ b/src/@types/ExcalidrawAutomate.d.ts
@@ -17,14 +17,14 @@ export declare class ExcalidrawAutomate {
theme?: string,
padding?: number
): Promise;
-
+
/**
* utility function to generate EmbeddedFilesLoader object
* @param isDark
* @returns
*/
getEmbeddedFilesLoader(isDark?: boolean): any;
-
+
/**
* utility function to generate ExportSettings object
* @param withBackground
diff --git a/src/GitHub/files.ts b/src/GitHub/files.ts
index f3ac5abe..585bcb3d 100644
--- a/src/GitHub/files.ts
+++ b/src/GitHub/files.ts
@@ -613,9 +613,11 @@ export class FilesManagement extends Publisher {
repoPath: string
): Promise {
//first check if the file exist in github
- if (this.settings.embed.forcePush ||
+ if (
+ this.settings.embed.forcePush ||
this.settings.embed.forcePush == null ||
- this.settings.github.dryRun.enable)
+ this.settings.github.dryRun.enable
+ )
return true;
const githubFile = await this.octokit.request("GET /repos/{owner}/{repo}/commits", {
owner: repo?.user ?? this.settings.github.user,
diff --git a/src/conversion/compiler/excalidraw.ts b/src/conversion/compiler/excalidraw.ts
index 0f4d74c8..73b4609c 100644
--- a/src/conversion/compiler/excalidraw.ts
+++ b/src/conversion/compiler/excalidraw.ts
@@ -1,5 +1,5 @@
import type { App, TFile } from "obsidian";
-import type {ExcalidrawAutomate} from "../../@types/ExcalidrawAutomate";
+import type { ExcalidrawAutomate } from "../../@types/ExcalidrawAutomate";
/**
* @param file
diff --git a/src/conversion/file_path.ts b/src/conversion/file_path.ts
index 66977056..5e8db254 100644
--- a/src/conversion/file_path.ts
+++ b/src/conversion/file_path.ts
@@ -29,7 +29,7 @@ import {
getFrontmatterSettings,
getProperties,
} from "src/utils/parse_frontmatter";
-import {merge} from "ts-deepmerge";
+import { merge } from "ts-deepmerge";
/** Search a link in the entire frontmatter value */
/** Link will always be in the form of [[]] */
@@ -183,7 +183,7 @@ export async function createRelativePath(
.at(-1) as string,
};
}
- return {link: relative};
+ return { link: relative };
}
/**
diff --git a/src/conversion/links.ts b/src/conversion/links.ts
index 66bed51b..e85aceeb 100644
--- a/src/conversion/links.ts
+++ b/src/conversion/links.ts
@@ -12,7 +12,7 @@ import {
textIsInFrontmatter,
} from "src/conversion/file_path";
import { replaceText } from "src/conversion/find_and_replace_text";
-import {isAttachment, noTextConversion} from "src/utils/data_validation_test";
+import { isAttachment, noTextConversion } from "src/utils/data_validation_test";
import type Enveloppe from "../main";
type IsEmbed = {
@@ -381,7 +381,7 @@ export async function convertToInternalGithub(
);
continue;
}
-
+
const regToReplace = new RegExp(`((${escapedLinkedFile})|(${linkInMarkdown}))`);
let pathInGithubWithAnchor = pathInGithub;
if (linkedFile.anchor) {
@@ -403,7 +403,7 @@ export async function convertToInternalGithub(
: pathInGithub;
}
const altText = link.match(/\[(.*)\]/)![1];
-
+
newLink = `[${altText}](${encodeURI(pathInGithub)})`; //encode to URI for compatibility with github
}
newLink = addAltText(newLink, linkedFile);
diff --git a/src/interfaces/main.ts b/src/interfaces/main.ts
index f80e89c1..4f47d035 100644
--- a/src/interfaces/main.ts
+++ b/src/interfaces/main.ts
@@ -1,6 +1,6 @@
import type { FrontMatterCache, TFile } from "obsidian";
-import type {ESettingsTabId, FolderSettings, TypeOfEditRegex} from "./enum";
+import type { ESettingsTabId, FolderSettings, TypeOfEditRegex } from "./enum";
import type {
Api,
Conversion,
@@ -248,7 +248,7 @@ export interface PropertiesConversion {
convertInternalLinks: boolean;
/** Include also linked files in the send/conversion */
includeLinks: boolean;
-
+
/** Remove link if not shared */
unlink: boolean;
}
diff --git a/src/settings.ts b/src/settings.ts
index 8d1b8564..dc997069 100644
--- a/src/settings.ts
+++ b/src/settings.ts
@@ -319,7 +319,7 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
await this.plugin.saveSettings();
})
);
-
+
new Setting(this.settingsPage)
.setName(i18next.t("settings.github.dryRun.enable.title"))
.setDesc(i18next.t("settings.github.dryRun.enable.desc"))
@@ -907,7 +907,7 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
await this.renderEmbedConfiguration();
});
});
-
+
new Setting(this.settingsPage)
.setName(i18next.t("settings.embed.forcePush.title"))
.setDesc(i18next.t("settings.embed.forcePush.desc"))
@@ -917,7 +917,7 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
await this.plugin.saveSettings();
})
);
-
+
this.settingsPage.createEl("h5", {
text: i18next.t("settings.embed.attachment"),
cls: "center",
@@ -984,7 +984,7 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
.addTextArea((text) => {
text
.setPlaceholder("py, mdx")
- .setValue((embedSettings.unHandledObsidianExt||[]).join(", "))
+ .setValue((embedSettings.unHandledObsidianExt || []).join(", "))
.onChange(async (value) => {
embedSettings.unHandledObsidianExt = value
.split(/[,\n]\W*/)
@@ -1001,7 +1001,7 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
.addTextArea((text) => {
text
.setPlaceholder("banner")
- .setValue((embedSettings.keySendFile||[]).join(", "))
+ .setValue((embedSettings.keySendFile || []).join(", "))
.onChange(async (value) => {
embedSettings.keySendFile = value
.split(/[,\n]\W*/)
@@ -1026,7 +1026,7 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
await this.renderEmbedConfiguration();
});
});
-
+
if (embedSettings.notes) {
new Setting(this.settingsPage)
.setName(i18next.t("settings.embed.links.title"))
@@ -1071,7 +1071,7 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
await this.plugin.saveSettings();
}
await this.plugin.saveSettings();
-
+
const bakeEmbedDesc = dedent(`
${i18next.t("settings.embed.bake.title")}
${i18next.t("settings.embed.bake.text")}. ${i18next.t("settings.embed.bake.variable.desc")}
@@ -1080,8 +1080,8 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
{{url}}
${i18next.t("settings.embed.bake.variable.url")}
⚠️ ${i18next.t("settings.embed.bake.warning")}
- `)
-
+ `);
+
this.settingsPage.appendChild(sanitizeHTMLToDom(bakeEmbedDesc));
new Setting(this.settingsPage)
diff --git a/src/settings/help.ts b/src/settings/help.ts
index 4216666d..2820a7a7 100644
--- a/src/settings/help.ts
+++ b/src/settings/help.ts
@@ -2,7 +2,7 @@ import { FolderSettings, type EnveloppeSettings } from "@interfaces";
import dedent from "dedent";
import i18next from "i18next";
import { normalizePath, sanitizeHTMLToDom } from "obsidian";
-import {DISCORD_ICON, DISCUSSION_ICON, DOCUMENTATION, GITHUB_ICON, ISSUE, TRANSLATION_ICON} from "@interfaces/icons";
+import { DISCORD_ICON, DISCUSSION_ICON, DOCUMENTATION, GITHUB_ICON, ISSUE, TRANSLATION_ICON } from "@interfaces/icons";
/**
* Export the YAML help to create an example of yaml with the value based on the Settings
diff --git a/src/settings/migrate.ts b/src/settings/migrate.ts
index d05cd70b..4b65a262 100644
--- a/src/settings/migrate.ts
+++ b/src/settings/migrate.ts
@@ -83,7 +83,7 @@ async function migrateReplaceTitle(plugin: Enveloppe) {
if (plugin.settings.upload.replaceTitle instanceof Array) {
return;
}
-
+
plugin.console.trace(i18next.t("informations.migrating.fileReplace"));
plugin.settings.upload.replaceTitle = [plugin.settings.upload.replaceTitle];
await plugin.saveSettings();
diff --git a/src/settings/modals/list_changed.ts b/src/settings/modals/list_changed.ts
index 5a27941f..52fdc853 100644
--- a/src/settings/modals/list_changed.ts
+++ b/src/settings/modals/list_changed.ts
@@ -11,7 +11,7 @@ export class ListChangedFiles extends Modal {
displayListOfFile(toDisplay: string[], contentEl: HTMLElement) {
if (!toDisplay.length) return;
- const ul = contentEl.createEl("ul", {cls: "list"});
+ const ul = contentEl.createEl("ul", { cls: "list" });
toDisplay.forEach((file) => {
let emoji = "❓";
const ext = file.split(".").pop() ?? "";
@@ -61,8 +61,8 @@ export class ListChangedFiles extends Modal {
text: `🗑️ ${i18next.t("modals.listChangedFiles.deleted")}`,
});
this.displayListOfFile(this.listChanged.deleted, contentEl);
-
- const span = contentEl.createDiv({cls: "error"});
+
+ const span = contentEl.createDiv({ cls: "error" });
span.createEl("h2", {
text: `❌ ${i18next.t("modals.listChangedFiles.error")}`,
});
@@ -80,7 +80,7 @@ export class ListChangedFiles extends Modal {
text: `🗑️ ${i18next.t("modals.listChangedFiles.deleted")}`,
});
this.displayListOfFile(this.listChanged.deleted, contentEl);
- const span = contentEl.createSpan({cls: "error"});
+ const span = contentEl.createSpan({ cls: "error" });
span.createEl("h3", {
text: `❌ ${i18next.t("modals.listChangedFiles.error")}`,
});
diff --git a/src/settings/modals/manage_repo.ts b/src/settings/modals/manage_repo.ts
index 0be98ad2..568b2c1e 100644
--- a/src/settings/modals/manage_repo.ts
+++ b/src/settings/modals/manage_repo.ts
@@ -1,4 +1,4 @@
-import {type EnveloppeSettings, GithubTiersVersion, type Repository} from "@interfaces";
+import { type EnveloppeSettings, GithubTiersVersion, type Repository } from "@interfaces";
import i18next from "i18next";
import {
AbstractInputSuggest,
@@ -9,7 +9,7 @@ import {
type TFile,
} from "obsidian";
import type Enveloppe from "src/main";
-import {migrateToken} from "src/settings/migrate";
+import { migrateToken } from "src/settings/migrate";
import {
checkRepositoryValidity,
verifyRateLimitAPI,
diff --git a/src/settings/style.ts b/src/settings/style.ts
index a96a281e..a7066dda 100644
--- a/src/settings/style.ts
+++ b/src/settings/style.ts
@@ -1,4 +1,4 @@
-import {ESettingsTabId, FolderSettings, type EnveloppeSettings} from "@interfaces";
+import { ESettingsTabId, FolderSettings, type EnveloppeSettings } from "@interfaces";
import i18next from "i18next";
import { Notice, type Setting } from "obsidian";
import type Enveloppe from "src/main";
diff --git a/src/styles.css b/src/styles.css
index 2ee16fb4..324c907e 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -102,9 +102,7 @@ a.enveloppe-download {
text-align: center;
white-space: nowrap;
text-decoration: none;
- transition:
- background-color 0.1s ease,
- box-shadow 0.1s ease;
+ transition: background-color 0.1s ease, box-shadow 0.1s ease;
}
.enveloppe-import-label:hover,
diff --git a/src/utils/parse_frontmatter.ts b/src/utils/parse_frontmatter.ts
index 65ee9f3e..b5caca96 100644
--- a/src/utils/parse_frontmatter.ts
+++ b/src/utils/parse_frontmatter.ts
@@ -11,10 +11,10 @@ import {
type PropertiesConversion,
type Repository,
} from "@interfaces";
-import {klona} from "klona";
-import {type FrontMatterCache, normalizePath, TFile} from "obsidian";
+import { klona } from "klona";
+import { type FrontMatterCache, normalizePath, TFile } from "obsidian";
import type Enveloppe from "src/main";
-import {merge} from "ts-deepmerge";
+import { merge } from "ts-deepmerge";
export function frontmatterSettingsRepository(
plugin: Enveloppe,
@@ -361,7 +361,7 @@ export function getCategory(
const category =
frontmatter && frontmatter[key] != undefined
? frontmatter[key]
- : paths?.defaultName ?? settings.upload.defaultName;
+ : (paths?.defaultName ?? settings.upload.defaultName);
if (category instanceof Array) {
return category.join("/");
}
@@ -700,7 +700,7 @@ export function mergeFrontmatter(
delete sourceFrontmatter?.[shareKey];
if (sourceFrontmatter && frontmatter)
frontmatter = merge.withOptions(
- {allowUndefinedOverrides: false},
+ { allowUndefinedOverrides: false },
sourceFrontmatter,
frontmatter
);