diff --git a/src/ActivityImporter.ts b/src/ActivityImporter.ts index a637ff9..5ad9baf 100644 --- a/src/ActivityImporter.ts +++ b/src/ActivityImporter.ts @@ -17,7 +17,7 @@ export class ActivityImporter { await this.stravaApi.refreshTokenIfExpired(); try { - let params: { per_page: number; after?: number } = { + const params: { per_page: number; after?: number } = { per_page: this.PER_PAGE }; diff --git a/src/ActivityRenderer.ts b/src/ActivityRenderer.ts index ddf770d..6de905f 100644 --- a/src/ActivityRenderer.ts +++ b/src/ActivityRenderer.ts @@ -43,11 +43,11 @@ export class ActivityRenderer { } renderFrontMatter(activity: Activity) { - let frontMatter: { [id: string]: unknown } = { + const frontMatter: { [id: string]: unknown } = { id: activity.id }; - this.frontMatterProperties!.forEach((property) => { + this.frontMatterProperties?.forEach((property) => { frontMatter[property] = property === "icon" ? this.getActivityIcon(activity.sport_type) : activity[property]; }); diff --git a/src/ActivitySerializer.ts b/src/ActivitySerializer.ts index da831d1..ad41887 100644 --- a/src/ActivitySerializer.ts +++ b/src/ActivitySerializer.ts @@ -5,9 +5,10 @@ import { ActivityRenderer } from "./ActivityRenderer"; // On Unix-like systems / is reserved and <>:"/\|?* as well as non-printable characters \u0000-\u001F on Windows // credit: https://github.com/sindresorhus/filename-reserved-regex -// eslint-disable-next-line no-control-regex const REPLACEMENT_CHAR = '-'; +// eslint-disable-next-line no-control-regex const ILLEGAL_CHAR_REGEX_FILE = /[<>:"/\\|?*\u0000-\u001F]/g; +// eslint-disable-next-line no-control-regex const ILLEGAL_CHAR_REGEX_FOLDER = /[<>:"\\|?*\u0000-\u001F]/g; export class ActivitySerializer { diff --git a/src/SettingsTab.ts b/src/SettingsTab.ts index 0ce268f..8980a82 100644 --- a/src/SettingsTab.ts +++ b/src/SettingsTab.ts @@ -82,7 +82,7 @@ export class SettingsTab extends PluginSettingTab { }); if (this.plugin.settings.authentication.stravaAccessToken) { - let el = containerEl.createEl("div"); + const el = containerEl.createEl("div"); el.setText("✅"); containerEl.find(".strava-sync-authenticate > .setting-item-control ").prepend(el); } @@ -271,7 +271,7 @@ export class SettingsTab extends PluginSettingTab { text.inputEl.setAttr('cols', 50) }) - let el = containerEl.createEl("div"); + const el = containerEl.createEl("div"); el.innerHTML = ``; el.classList.add("strava-powered-by"); containerEl.appendChild(el);