Browse Source

Fix lint error and changed import

arvid-e 8 months ago
parent
commit
6e631a6541
1 changed files with 5 additions and 4 deletions
  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 { InlineCode as MdastInlineCode, Html, Text } from 'mdast';
 import type { Plugin } from 'unified';
 import type { Plugin } from 'unified';
 import type { Node, Parent, Point } from 'unist';
 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');
   const mod = await import('unist-util-visit');
   visit = mod.visit;
   visit = mod.visit;
 })();
 })();
 
 
+
 type InlineCode = MdastInlineCode & {
 type InlineCode = MdastInlineCode & {
   data?: {
   data?: {
     hProperties?: Properties;
     hProperties?: Properties;
@@ -37,7 +38,7 @@ export const remarkPlugin: Plugin = () => {
     const defaultPoint: Point = { line: 1, column: 1, offset: 0 };
     const defaultPoint: Point = { line: 1, column: 1, offset: 0 };
 
 
     if (typeof visit === 'undefined') {
     if (typeof visit === 'undefined') {
-        return tree;
+      return tree;
     }
     }
 
 
     visit(tree, 'html', (node: Html, index: number | undefined, parent: Parent | undefined) => {
     visit(tree, 'html', (node: Html, index: number | undefined, parent: Parent | undefined) => {