Fix ESLint issues

This commit is contained in:
Sidharth Vinod
2021-06-02 12:27:22 +05:30
parent c0b353dbfd
commit 1d25499b86
6 changed files with 28 additions and 16 deletions
+4 -4
View File
@@ -62,8 +62,8 @@
};
};
const isClipboardAvailable = () => {
return Object.prototype.hasOwnProperty.call(window, 'ClipboardItem');
const isClipboardAvailable = (): boolean => {
return Object.prototype.hasOwnProperty.call(window, 'ClipboardItem') as boolean;
};
const clipboardCopy: Exporter = (context, image) => {
@@ -102,7 +102,7 @@
);
};
const onCopyMarkdown = (event) => {
const onCopyMarkdown = (event: Event) => {
event.target.select();
document.execCommand('Copy');
};
@@ -113,7 +113,7 @@
let imagemodeselected = 'auto';
let userimagesize = 1080;
base64State.subscribe((b64Code) => {
base64State.subscribe((b64Code: string) => {
iUrl = `https://mermaid.ink/img/${b64Code}`;
svgUrl = `https://mermaid.ink/svg/${b64Code}`;
mdCode = `[![](${iUrl})](${window.location.protocol}//${window.location.host}${window.location.pathname}/edit#${b64Code})`;
+1 -1
View File
@@ -42,7 +42,7 @@
initEditor(Monaco);
editor = Monaco.editor.create(divEl, editorOptions);
editor.onDidChangeModelContent(async () => {
editor.onDidChangeModelContent(() => {
text = editor.getValue();
dispatch('update', {
text
+1 -1
View File
@@ -11,7 +11,7 @@
let error = false;
let outOfSync = false;
let manualUpdate = true;
onMount(async () => {
onMount(() => {
codeStore.subscribe((state) => {
try {
if (container && state && (state.updateDiagram || state.autoSync)) {