Fix all biome linter errors (#541)
This commit is contained in:
parent
f23c73f6a5
commit
e5d654bf41
46 changed files with 317 additions and 275 deletions
|
|
@ -1,13 +1,15 @@
|
|||
import Link from 'next/link';
|
||||
import React, { memo } from 'react';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import ReactMarkdown, { type Components } from 'react-markdown';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
|
||||
const NonMemoizedMarkdown = ({ children }: { children: string }) => {
|
||||
const components = {
|
||||
code: ({ node, inline, className, children, ...props }: any) => {
|
||||
const components: Partial<Components> = {
|
||||
// @ts-expect-error
|
||||
code: ({ node, inline, className, children, ...props }) => {
|
||||
const match = /language-(\w+)/.exec(className || '');
|
||||
return !inline && match ? (
|
||||
// @ts-expect-error
|
||||
<pre
|
||||
{...props}
|
||||
className={`${className} text-sm w-[80dvw] md:max-w-[500px] overflow-x-scroll bg-zinc-100 p-3 rounded-lg mt-2 dark:bg-zinc-800`}
|
||||
|
|
@ -23,36 +25,37 @@ const NonMemoizedMarkdown = ({ children }: { children: string }) => {
|
|||
</code>
|
||||
);
|
||||
},
|
||||
ol: ({ node, children, ...props }: any) => {
|
||||
ol: ({ node, children, ...props }) => {
|
||||
return (
|
||||
<ol className="list-decimal list-outside ml-4" {...props}>
|
||||
{children}
|
||||
</ol>
|
||||
);
|
||||
},
|
||||
li: ({ node, children, ...props }: any) => {
|
||||
li: ({ node, children, ...props }) => {
|
||||
return (
|
||||
<li className="py-1" {...props}>
|
||||
{children}
|
||||
</li>
|
||||
);
|
||||
},
|
||||
ul: ({ node, children, ...props }: any) => {
|
||||
ul: ({ node, children, ...props }) => {
|
||||
return (
|
||||
<ul className="list-decimal list-outside ml-4" {...props}>
|
||||
{children}
|
||||
</ul>
|
||||
);
|
||||
},
|
||||
strong: ({ node, children, ...props }: any) => {
|
||||
strong: ({ node, children, ...props }) => {
|
||||
return (
|
||||
<span className="font-semibold" {...props}>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
},
|
||||
a: ({ node, children, ...props }: any) => {
|
||||
a: ({ node, children, ...props }) => {
|
||||
return (
|
||||
// @ts-expect-error
|
||||
<Link
|
||||
className="text-blue-500 hover:underline"
|
||||
target="_blank"
|
||||
|
|
@ -63,42 +66,42 @@ const NonMemoizedMarkdown = ({ children }: { children: string }) => {
|
|||
</Link>
|
||||
);
|
||||
},
|
||||
h1: ({ node, children, ...props }: any) => {
|
||||
h1: ({ node, children, ...props }) => {
|
||||
return (
|
||||
<h1 className="text-3xl font-semibold mt-6 mb-2" {...props}>
|
||||
{children}
|
||||
</h1>
|
||||
);
|
||||
},
|
||||
h2: ({ node, children, ...props }: any) => {
|
||||
h2: ({ node, children, ...props }) => {
|
||||
return (
|
||||
<h2 className="text-2xl font-semibold mt-6 mb-2" {...props}>
|
||||
{children}
|
||||
</h2>
|
||||
);
|
||||
},
|
||||
h3: ({ node, children, ...props }: any) => {
|
||||
h3: ({ node, children, ...props }) => {
|
||||
return (
|
||||
<h3 className="text-xl font-semibold mt-6 mb-2" {...props}>
|
||||
{children}
|
||||
</h3>
|
||||
);
|
||||
},
|
||||
h4: ({ node, children, ...props }: any) => {
|
||||
h4: ({ node, children, ...props }) => {
|
||||
return (
|
||||
<h4 className="text-lg font-semibold mt-6 mb-2" {...props}>
|
||||
{children}
|
||||
</h4>
|
||||
);
|
||||
},
|
||||
h5: ({ node, children, ...props }: any) => {
|
||||
h5: ({ node, children, ...props }) => {
|
||||
return (
|
||||
<h5 className="text-base font-semibold mt-6 mb-2" {...props}>
|
||||
{children}
|
||||
</h5>
|
||||
);
|
||||
},
|
||||
h6: ({ node, children, ...props }: any) => {
|
||||
h6: ({ node, children, ...props }) => {
|
||||
return (
|
||||
<h6 className="text-sm font-semibold mt-6 mb-2" {...props}>
|
||||
{children}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue