Skip to content

Commit

Permalink
style(lint): biome format with 1.9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Dec 28, 2024
1 parent 01539d0 commit 4b1b1d2
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions src/@types/ExcalidrawAutomate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ export declare class ExcalidrawAutomate {
theme?: string,
padding?: number
): Promise<SVGSVGElement>;

/**
* utility function to generate EmbeddedFilesLoader object
* @param isDark
* @returns
*/
getEmbeddedFilesLoader(isDark?: boolean): any;

/**
* utility function to generate ExportSettings object
* @param withBackground
Expand Down
6 changes: 4 additions & 2 deletions src/GitHub/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,11 @@ export class FilesManagement extends Publisher {
repoPath: string
): Promise<boolean> {
//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,
Expand Down
2 changes: 1 addition & 1 deletion src/conversion/compiler/excalidraw.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { App, TFile } from "obsidian";
import type {ExcalidrawAutomate} from "../../@types/ExcalidrawAutomate";
import type { ExcalidrawAutomate } from "../../@types/ExcalidrawAutomate";

/**
* @param file
Expand Down
4 changes: 2 additions & 2 deletions src/conversion/file_path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 [[]] */
Expand Down Expand Up @@ -183,7 +183,7 @@ export async function createRelativePath(
.at(-1) as string,
};
}
return {link: relative};
return { link: relative };
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/conversion/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -381,7 +381,7 @@ export async function convertToInternalGithub(
);
continue;
}

const regToReplace = new RegExp(`((${escapedLinkedFile})|(${linkInMarkdown}))`);
let pathInGithubWithAnchor = pathInGithub;
if (linkedFile.anchor) {
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/main.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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;
}
Expand Down
18 changes: 9 additions & 9 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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"))
Expand All @@ -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",
Expand Down Expand Up @@ -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*/)
Expand All @@ -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*/)
Expand All @@ -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"))
Expand Down Expand Up @@ -1071,7 +1071,7 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
await this.plugin.saveSettings();
}
await this.plugin.saveSettings();

const bakeEmbedDesc = dedent(`
<h5>${i18next.t("settings.embed.bake.title")}</h5>
<p>${i18next.t("settings.embed.bake.text")}. <span class="bake">${i18next.t("settings.embed.bake.variable.desc")}</span>
Expand All @@ -1080,8 +1080,8 @@ export class EnveloppeSettingsTab extends PluginSettingTab {
<li><code>{{url}}</code>${i18next.t("settings.embed.bake.variable.url")}</li>
</ul></p>
<p class="warning embed">⚠️ ${i18next.t("settings.embed.bake.warning")}</p>
`)
`);

this.settingsPage.appendChild(sanitizeHTMLToDom(bakeEmbedDesc));

new Setting(this.settingsPage)
Expand Down
2 changes: 1 addition & 1 deletion src/settings/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/settings/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions src/settings/modals/list_changed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() ?? "";
Expand Down Expand Up @@ -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")}`,
});
Expand All @@ -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")}`,
});
Expand Down
4 changes: 2 additions & 2 deletions src/settings/modals/manage_repo.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/settings/style.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 1 addition & 3 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions src/utils/parse_frontmatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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("/");
}
Expand Down Expand Up @@ -700,7 +700,7 @@ export function mergeFrontmatter(
delete sourceFrontmatter?.[shareKey];
if (sourceFrontmatter && frontmatter)
frontmatter = merge.withOptions(
{allowUndefinedOverrides: false},
{ allowUndefinedOverrides: false },
sourceFrontmatter,
frontmatter
);
Expand Down

0 comments on commit 4b1b1d2

Please sign in to comment.