From f89b35fcf17e708fc4c6153cc1d9400176427f8e Mon Sep 17 00:00:00 2001 From: zhuxining Date: Tue, 14 Nov 2023 14:06:59 +0800 Subject: [PATCH] fix tsconfig strict --- src/main.ts | 13 +++++-------- tsconfig.json | 4 +++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main.ts b/src/main.ts index e61ca96..d18e2dc 100755 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,6 @@ import { exec } from "child_process"; import { App, - Editor, - MarkdownView, Notice, Plugin, PluginSettingTab, @@ -51,7 +49,7 @@ const DEFAULT_SETTINGS: PluginSettings = { }; export default class AttachmentUploader extends Plugin { - settings: PluginSettings; + settings!: PluginSettings; async onload() { await this.loadSettings(); @@ -67,9 +65,7 @@ export default class AttachmentUploader extends Plugin { this.addCommand({ id: "upload-editor-attachments", name: "Upload editor attachments", - editorCallback: (editor: Editor, view: MarkdownView) => { - this.uploadEditorAttachment(); - }, + editorCallback: () => this.uploadEditorAttachment(), }); this.addSettingTab(new SettingTab(this.app, this)); @@ -218,9 +214,10 @@ export default class AttachmentUploader extends Plugin { errorMessage: stdout, }; } - } catch (err) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (err:any) { console.error(`err: ${err}`); - new Notice(err.message); + new Notice(err.message.toString()); throw err; } } diff --git a/tsconfig.json b/tsconfig.json index c3939c0..f7e2a34 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,9 @@ "importHelpers": true, "isolatedModules": true, "strictNullChecks": true, - "lib": ["DOM", "ES5", "ES6", "ES7"] + "lib": ["DOM", "ES5", "ES6", "ES7"], + "forceConsistentCasingInFileNames":true, + "strict": true, }, "include": ["**/*.ts"] }