Просмотр исходного кода

Fix lint error and changed import

arvid-e 8 месяцев назад
Родитель
Сommit
6e631a6541
1 измененных файлов с 5 добавлено и 4 удалено
  1. 5 4
      apps/app/src/services/renderer/remark-plugins/codeblock.ts

+ 5 - 4
apps/app/src/services/renderer/remark-plugins/codeblock.ts

@@ -3,15 +3,16 @@ import type { Schema as SanitizeOption } from 'hast-util-sanitize';
 import type { InlineCode as MdastInlineCode, Html, Text } from 'mdast';
 import type { Plugin } from 'unified';
 import type { Node, Parent, Point } from 'unist';
+import type { visit as UnistUtilVisitFunction } from 'unist-util-visit';
 
+let visit: typeof UnistUtilVisitFunction;
 
-let visit: typeof import('unist-util-visit').visit;
-
-(async () => {
+(async() => {
   const mod = await import('unist-util-visit');
   visit = mod.visit;
 })();
 
+
 type InlineCode = MdastInlineCode & {
   data?: {
     hProperties?: Properties;
@@ -37,7 +38,7 @@ export const remarkPlugin: Plugin = () => {
     const defaultPoint: Point = { line: 1, column: 1, offset: 0 };
 
     if (typeof visit === 'undefined') {
-        return tree;
+      return tree;
     }
 
     visit(tree, 'html', (node: Html, index: number | undefined, parent: Parent | undefined) => {