mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
Build/Refactor: lint pre-commit hook and reformat repo to spec (#314)
* build/refactor: move lint/prettier packages to project root, install husky, add pre-commit hook * refactor: reformat files * build: put full eslintrc back with all rules
This commit is contained in:
parent
8d75b25104
commit
7fdc862042
157 changed files with 4836 additions and 2403 deletions
|
|
@ -4,7 +4,7 @@ import rehypeKatex from 'rehype-katex';
|
|||
import rehypeHighlight from 'rehype-highlight';
|
||||
import remarkMath from 'remark-math';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
import rehypeRaw from 'rehype-raw'
|
||||
import rehypeRaw from 'rehype-raw';
|
||||
import CodeBlock from './CodeBlock';
|
||||
import { langSubset } from '~/utils/languages.mjs';
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ const Content = React.memo(({ content }) => {
|
|||
subset: langSubset
|
||||
}
|
||||
],
|
||||
[rehypeRaw],
|
||||
[rehypeRaw]
|
||||
];
|
||||
|
||||
return (
|
||||
|
|
@ -29,7 +29,7 @@ const Content = React.memo(({ content }) => {
|
|||
linkTarget="_new"
|
||||
components={{
|
||||
code,
|
||||
p,
|
||||
p
|
||||
// em,
|
||||
}}
|
||||
>
|
||||
|
|
@ -46,17 +46,12 @@ const code = React.memo((props) => {
|
|||
if (inline) {
|
||||
return <code className={className}>{children}</code>;
|
||||
} else {
|
||||
return (
|
||||
<CodeBlock
|
||||
lang={lang || 'text'}
|
||||
codeChildren={children}
|
||||
/>
|
||||
);
|
||||
return <CodeBlock lang={lang || 'text'} codeChildren={children} />;
|
||||
}
|
||||
});
|
||||
|
||||
const p = React.memo((props) => {
|
||||
return <p className="whitespace-pre-wrap mb-2">{props?.children}</p>;
|
||||
return <p className="mb-2 whitespace-pre-wrap">{props?.children}</p>;
|
||||
});
|
||||
|
||||
// const blinker = ({ node }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue