Skip to content

Commit

Permalink
fix tsconfig strict
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxining committed Nov 14, 2023
1 parent 939eb0e commit f89b35f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 5 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { exec } from "child_process";
import {
App,
Editor,
MarkdownView,
Notice,
Plugin,
PluginSettingTab,
Expand Down Expand Up @@ -51,7 +49,7 @@ const DEFAULT_SETTINGS: PluginSettings = {
};

export default class AttachmentUploader extends Plugin {
settings: PluginSettings;
settings!: PluginSettings;

async onload() {
await this.loadSettings();
Expand All @@ -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));
Expand Down Expand Up @@ -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;
}
}
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}

0 comments on commit f89b35f

Please sign in to comment.