diff --git a/package-lock.json b/package-lock.json index f363a778..7cfd7d89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,7 +60,7 @@ "cssnano": "^6.0.2", "eslint": "^9.39.4", "eslint-config-prettier": "^9.0.0", - "eslint-plugin-obsidianmd": "^0.3.0", + "eslint-plugin-obsidianmd": "^0.4.0", "eslint-plugin-prettier": "^5.0.0", "jiti": "^2.6.1", "jsesc": "^3.0.2", @@ -1840,6 +1840,36 @@ "w3c-keyname": "^2.2.4" } }, + "node_modules/@eslint-community/eslint-plugin-eslint-comments": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-4.7.2.tgz", + "integrity": "sha512-LF03qURSwEWm2dz5wtdDCzNk+7Opl0X7q6I3undsaIuNsEiNvRV3BCtqu14Q/6Pzg1tBj44LcxpW2EpSLZStZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^4.0.0", + "ignore": "^7.0.5" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0" + } + }, + "node_modules/@eslint-community/eslint-plugin-eslint-comments/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", @@ -7967,12 +7997,13 @@ } }, "node_modules/eslint-plugin-obsidianmd": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-obsidianmd/-/eslint-plugin-obsidianmd-0.3.0.tgz", - "integrity": "sha512-QvGDI6B2nxJBrsZKGTg31da2A/fEJNlnwN+fRZkaoPIu1QL3fYXUdpP7ThyMdr/0iTYQxifb9lt2X9cpydQx1w==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-obsidianmd/-/eslint-plugin-obsidianmd-0.4.0.tgz", + "integrity": "sha512-qZsh8ydaeO7bC+XADWHGG9+CEwiKjoL7arZo1I93e0UHdQ863Jzt+xRk5VI0vo97SIJrA4vWwuz9K9/fggO35g==", "dev": true, "license": "MIT", "dependencies": { + "@eslint-community/eslint-plugin-eslint-comments": "^4.7.2", "@eslint/config-helpers": "^0.4.2", "@eslint/js": "^9.30.1", "@eslint/json": "0.14.0", @@ -7981,7 +8012,7 @@ "@types/node": "20.12.12", "@typescript-eslint/types": "^8.33.1", "@typescript-eslint/utils": "^8.33.1", - "eslint": ">=9.0.0", + "eslint": ">=9.19.0", "eslint-plugin-depend": "1.3.1", "eslint-plugin-import": "^2.31.0", "eslint-plugin-json-schema-validator": "5.1.0", @@ -8002,7 +8033,7 @@ "peerDependencies": { "@eslint/js": "^9.30.1", "@eslint/json": "0.14.0", - "eslint": ">=9.0.0", + "eslint": ">=9.19.0", "obsidian": "1.8.7", "typescript-eslint": "^8.35.1" } diff --git a/package.json b/package.json index 6224d73a..3eb7276c 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "cssnano": "^6.0.2", "eslint": "^9.39.4", "eslint-config-prettier": "^9.0.0", - "eslint-plugin-obsidianmd": "^0.3.0", + "eslint-plugin-obsidianmd": "^0.4.0", "eslint-plugin-prettier": "^5.0.0", "jiti": "^2.6.1", "jsesc": "^3.0.2", diff --git a/src/core/index.ts b/src/core/index.ts index b8289784..8dfc24aa 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -17,11 +17,11 @@ export type { Point } from "src/types/types"; export const getEA = (view?: ExcalidrawView): ExcalidrawAutomate | null => { try { return window.ExcalidrawAutomate.getAPI(view); - } catch (error) { + } catch (error: unknown) { errorlog({ message: "Excalidraw not available", fn: getEA, - error: error as unknown, + error: error, }); return null; } diff --git a/src/core/main.ts b/src/core/main.ts index 37f76794..be192224 100644 --- a/src/core/main.ts +++ b/src/core/main.ts @@ -1277,11 +1277,11 @@ export default class ExcalidrawPlugin extends Plugin { setButtonBgColor(b, "success"); hideElement(b); }); - } catch (e) { + } catch (e: unknown) { errorlog({ where: "this.registerInstallCodeblockProcessor", source, - error: e as unknown, + error: e, }); } diff --git a/src/shared/Dialogs/Messages.ts b/src/shared/Dialogs/Messages.ts index 968e6376..1f410254 100644 --- a/src/shared/Dialogs/Messages.ts +++ b/src/shared/Dialogs/Messages.ts @@ -18,6 +18,8 @@ I build this plugin as a labor of love. Curious about the philosophy behind it?
Buy Me a Coffee at ko-fi.com
`, "2.25.0": ` +${getYouTubeDiv("aqt5NJE2sJ8")} + ## New from Excalidraw.com - Significantly improved ink flow for freedraw pen. You can now toggle between pressure sensitive and constant mode for the default excalidraw.com freedraw pen. [#11507](${URLs.GITHUB_COM_EXCALIDRAW_EXCALIDRAW_PULL}/11507), [#11551](${URLs.GITHUB_COM_EXCALIDRAW_EXCALIDRAW_PULL}/11551) diff --git a/src/shared/Dialogs/ScriptInstallPrompt.ts b/src/shared/Dialogs/ScriptInstallPrompt.ts index c2b94a97..e3640b8d 100644 --- a/src/shared/Dialogs/ScriptInstallPrompt.ts +++ b/src/shared/Dialogs/ScriptInstallPrompt.ts @@ -55,8 +55,8 @@ export class ScriptInstallPrompt extends Modal { this.contentDiv.querySelectorAll("a.internal-link").forEach((el) => { el.removeAttribute("target"); }); - } catch (e) { - errorlog({ where: "ScriptInstallPrompt.onOpen", error: e as unknown }); + } catch (e: unknown) { + errorlog({ where: "ScriptInstallPrompt.onOpen", error: e }); new Notice(t("SCRIPT_INSTALL_PROMPT_OPEN_ERROR")); this.close(); } diff --git a/src/shared/EmbeddedFileLoader.ts b/src/shared/EmbeddedFileLoader.ts index 84e2b1ba..a55fab11 100644 --- a/src/shared/EmbeddedFileLoader.ts +++ b/src/shared/EmbeddedFileLoader.ts @@ -1917,10 +1917,10 @@ export const generateIdFromFile = async ( id = Array.from(new Uint8Array(hashBuffer)) .map((byte) => byte.toString(16).padStart(2, "0")) .join("") as FileId; - } catch (error) { + } catch (error: unknown) { errorlog({ where: "EmbeddedFileLoader.generateIdFromFile", - error: error as unknown, + error: error, }); id = fileid() as FileId; } diff --git a/src/shared/ExcalidrawData.ts b/src/shared/ExcalidrawData.ts index 885d03f3..7313b192 100644 --- a/src/shared/ExcalidrawData.ts +++ b/src/shared/ExcalidrawData.ts @@ -714,13 +714,13 @@ export class ExcalidrawData { container.boundElements = [ { id: textEl.id, type: "text" as "text" | "arrow" }, ].concat(boundEl); - } catch (e) { + } catch (e: unknown) { errorlog({ message: "unexpected error in initializeNonInitializedFields", context: this.initializeNonInitializedFields.bind( this, ) as unknown, - error: e as unknown, + error: e, }); } }, diff --git a/src/utils/excalidrawViewHelpers.ts b/src/utils/excalidrawViewHelpers.ts index 243cf1cd..0bace46d 100644 --- a/src/utils/excalidrawViewHelpers.ts +++ b/src/utils/excalidrawViewHelpers.ts @@ -114,10 +114,10 @@ export const insertLaTeXToView = ( } ea.destroy(); }, - (e) => { + (e: unknown) => { // Promise rejection handler (e.g. user cancelled prompt or Extras plugin is missing) if (e && e instanceof Error) { - errorlog({ message: "LaTeX Insertion aborted", error: e as unknown }); + errorlog({ message: "LaTeX Insertion aborted", error: e }); } }, ); diff --git a/src/utils/scriptLibraryUtils.ts b/src/utils/scriptLibraryUtils.ts index fedf15d9..b02945e7 100644 --- a/src/utils/scriptLibraryUtils.ts +++ b/src/utils/scriptLibraryUtils.ts @@ -52,12 +52,12 @@ export const installButton = async ( let decodedURI = source; try { decodedURI = decodeURI(source); - } catch (e) { + } catch (e: unknown) { errorlog({ where: "ExcalidrawPlugin.registerInstallCodeblockProcessor.codeblockProcessor.onClick", source, - error: e as unknown, + error: e, }); } const fname = decodedURI.substring(decodedURI.lastIndexOf("/") + 1); diff --git a/src/view/ExcalidrawView.ts b/src/view/ExcalidrawView.ts index 4cb8d9d4..eb3a6073 100644 --- a/src/view/ExcalidrawView.ts +++ b/src/view/ExcalidrawView.ts @@ -3351,10 +3351,10 @@ export default class ExcalidrawView ) { return; } - } catch (e) { + } catch (e: unknown) { errorlog({ where: "ExcalidrawView.setViewData", - error: e as unknown, + error: e, }); if ( e instanceof Error && @@ -3489,10 +3489,10 @@ export default class ExcalidrawView excalidrawFile: this.file, view: this, }); - } catch (e) { + } catch (e: unknown) { errorlog({ where: "ExcalidrawView.setViewData.onFileOpenHook", - error: e as unknown, + error: e, }); } finally { tempEA.destroy(); diff --git a/src/view/managers/DropManager.ts b/src/view/managers/DropManager.ts index 2e5239e7..d771f0d0 100644 --- a/src/view/managers/DropManager.ts +++ b/src/view/managers/DropManager.ts @@ -147,9 +147,9 @@ export class DropManager { view: this.view, //the excalidraw view receiving the drop pointerPosition: this.currentPosition, //the pointer position on canvas at the time of drop }); - } catch (e) { + } catch (e: unknown) { new Notice("On drop hook error. See console log for details"); - errorlog({ where: "ExcalidrawView.onDrop", error: e as unknown }); + errorlog({ where: "ExcalidrawView.onDrop", error: e }); return false; } } else {