From d2deae3fde2ad89185233ab7041239ba0b4b71c1 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sun, 23 Jul 2023 06:55:00 +0000 Subject: [PATCH] style: format code with prettier and standardjs Format code with prettier and standardjs This commit fixes the style issues introduced in bfcfb2f according to the output from Prettier and StandardJS. Details: https://app.deepsource.com/gh/wkylin/pro-react-admin/transform/b3fb9cda-b8a9-42b0-8a98-325c4420f846/ --- src/pages/chatgpt/index.jsx | 42 ++++++++++++++++++------------------- src/pages/chatgpt/sse.js | 12 +++++------ src/pages/three/index.jsx | 6 +++--- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/pages/chatgpt/index.jsx b/src/pages/chatgpt/index.jsx index a991648b..0dd4ae61 100644 --- a/src/pages/chatgpt/index.jsx +++ b/src/pages/chatgpt/index.jsx @@ -47,7 +47,7 @@ const ChatGpt = () => { if (e.data !== '[DONE]') { const payload = JSON.parse(e.data) const { - delta: { content }, + delta: { content } } = payload.choices[0] if (content) { apiResultRef.current += content @@ -118,7 +118,7 @@ const ChatGpt = () => { if (e.data !== '[DONE]') { const payload = JSON.parse(e.data) const { - delta: { content }, + delta: { content } } = payload.choices[0] if (content) { structureResultRef.current += content @@ -144,35 +144,35 @@ const ChatGpt = () => {
- + - + - @@ -190,11 +190,11 @@ const ChatGpt = () => { items: [ { key: '1', - label: '复制Markdown', - }, - ], + label: '复制Markdown' + } + ] }} - placement="bottom" + placement='bottom' arrow > @@ -229,18 +229,18 @@ const ChatGpt = () => { items: [ { key: '1', - label: '导出png格式', + label: '导出png格式' }, { key: '2', - label: '导出svg格式', - }, - ], + label: '导出svg格式' + } + ] }} - placement="bottom" + placement='bottom' arrow > - diff --git a/src/pages/chatgpt/sse.js b/src/pages/chatgpt/sse.js index c1e16c41..f3f57408 100644 --- a/src/pages/chatgpt/sse.js +++ b/src/pages/chatgpt/sse.js @@ -1,10 +1,10 @@ import { SSE } from 'sse' const initSSE = (apiKey, apiContent) => { - const source = new SSE(`https://api.openai.com/v1/chat/completions`, { + const source = new SSE('https://api.openai.com/v1/chat/completions', { headers: { 'Content-Type': 'application/json', - Authorization: `Bearer ${apiKey}`, + Authorization: `Bearer ${apiKey}` }, method: 'POST', payload: JSON.stringify({ @@ -13,10 +13,10 @@ const initSSE = (apiKey, apiContent) => { messages: [ { role: 'assistant', - content: apiContent, - }, - ], - }), + content: apiContent + } + ] + }) }) return source } diff --git a/src/pages/three/index.jsx b/src/pages/three/index.jsx index 4638a398..3a499af8 100644 --- a/src/pages/three/index.jsx +++ b/src/pages/three/index.jsx @@ -5,7 +5,7 @@ import * as random from 'maath/random/dist/maath-random.esm' import styles from './index.module.less' -export default function ReactThree() { +export default function ReactThree () { return (

React Three Fiber

@@ -16,7 +16,7 @@ export default function ReactThree() { ) } -function Stars(props) { +function Stars (props) { const ref = useRef() const [sphere] = useState(() => random.inSphere(new Float32Array(5000), { radius: 1.5 })) useFrame((state, delta) => { @@ -26,7 +26,7 @@ function Stars(props) { return ( - + )