From cc38876871053cdca61dc4a5c5beeecb4f9d5227 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:12:47 +0000 Subject: [PATCH] style: format code with Prettier and StandardJS This commit fixes the style issues introduced in a0dc9d3 according to the output from Prettier and StandardJS. Details: None --- postcss.config.js | 4 +- .../container/masonryContainer/index.jsx | 14 +- .../container/musicPlayer/index.jsx | 12 +- src/components/stateless/CompareAll/index.jsx | 82 ++++----- .../stateless/FeatureAny/TextComponent.jsx | 8 +- src/components/stateless/FeatureAny/index.jsx | 20 +-- .../stateless/HorizontalScroll/index.jsx | 24 +-- src/components/stateless/Meteors/index.jsx | 4 +- src/components/stateless/ShiCode/index.jsx | 34 ++-- src/components/stateless/TagCloud/index.jsx | 42 ++--- src/components/stateless/TextLoader/index.jsx | 20 +-- src/pages/demo/index.jsx | 32 ++-- src/pages/echarts/index.jsx | 60 +++---- src/pages/home/index.jsx | 158 +++++++++--------- src/pages/reactPdf/index.jsx | 36 ++-- 15 files changed, 278 insertions(+), 272 deletions(-) diff --git a/postcss.config.js b/postcss.config.js index 52b9b4ba..4d8610d7 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,5 +1,5 @@ module.exports = { plugins: { - '@tailwindcss/postcss': {}, - }, + '@tailwindcss/postcss': {} + } } diff --git a/src/components/container/masonryContainer/index.jsx b/src/components/container/masonryContainer/index.jsx index 943799b1..0cec5d64 100644 --- a/src/components/container/masonryContainer/index.jsx +++ b/src/components/container/masonryContainer/index.jsx @@ -4,25 +4,25 @@ const MyMasonry = () => { const masonryContainer = useMasonry() return (
-
{content}
-{content}
++ className='absolute inset-0 z-0 transition-transform duration-300 group-hover:scale-110' + /> +
{card.title}
{tokens.map((line, i) => ( diff --git a/src/components/stateless/TagCloud/index.jsx b/src/components/stateless/TagCloud/index.jsx index 5960db33..e274cc16 100644 --- a/src/components/stateless/TagCloud/index.jsx +++ b/src/components/stateless/TagCloud/index.jsx @@ -3,63 +3,63 @@ import styles from './index.module.less' const TagCloud = () => { return ( ----
- +
+) } diff --git a/src/components/stateless/TextLoader/index.jsx b/src/components/stateless/TextLoader/index.jsx index 479a302d..9af1108f 100644 --- a/src/components/stateless/TextLoader/index.jsx +++ b/src/components/stateless/TextLoader/index.jsx @@ -2,17 +2,17 @@ import React, { useState, useEffect } from 'react' import { motion, AnimatePresence } from 'motion/react' -export function LoadingText({ text, dots }) { +export function LoadingText ({ text, dots }) { return ( -+- ++
- 'use server'
-- +
- useOptimistic
-- +
- React Server Components
-- +
- Concurrent Rendering
-- +
- useActionState
-- +
- Improved Hydration
-- +
- Form Actions
-- +
- Server Actions
-- +
- Suspense
-- +
- 'use client'
-- +
- useTransition
-- +
- React Compiler
-- +
- Streaming
-- +
- useFormStatus
-- +
- New React Hooks
-- +
- use()
-- +
- Automatic Memoization
-+ +{text} {dots} @@ -43,14 +43,14 @@ const TextLoader = ({ messages, interval = 2000, dotCount = 3, direction = 'vert if (direction === 'horizontal') { return ( - +@@ -59,14 +59,14 @@ const TextLoader = ({ messages, interval = 2000, dotCount = 3, direction = 'vert } return ( - +diff --git a/src/pages/demo/index.jsx b/src/pages/demo/index.jsx index a1cb8299..53655a14 100644 --- a/src/pages/demo/index.jsx +++ b/src/pages/demo/index.jsx @@ -7,19 +7,19 @@ const columns = [ title: 'Name', align: 'center', dataIndex: 'name', - width: 150, + width: 150 }, { title: 'Age', align: 'center', dataIndex: 'age', - width: 150, + width: 150 }, { title: 'Address', align: 'center', - dataIndex: 'address', - }, + dataIndex: 'address' + } ] const tabs = [ @@ -27,52 +27,52 @@ const tabs = [ title: 'Product', value: 'product', content: ( - +- ), + ) }, { title: 'Services', value: 'services', content: ( -Product Tab
+- ), + ) }, { title: 'Playground', value: 'playground', content: ( -Services tab
+- ), + ) }, { title: 'Content', value: 'content', content: ( -Playground tab
+- ), + ) }, { title: 'Random', value: 'random', content: ( -Content tab
+- ), - }, + ) + } ] const ProDemo = () => { return (Random tab
- +diff --git a/src/pages/echarts/index.jsx b/src/pages/echarts/index.jsx index 59348b1e..c9e26853 100644 --- a/src/pages/echarts/index.jsx +++ b/src/pages/echarts/index.jsx @@ -7,78 +7,78 @@ const Echarts = () => { tooltip: { trigger: 'axis', axisPointer: { - type: 'shadow-sm', - }, + type: 'shadow-sm' + } }, legend: { - data: ['Direct', 'Email', 'Union Ads', 'Video Ads', 'Search Engine', 'Baidu', 'Google', 'Bing', 'Others'], + data: ['Direct', 'Email', 'Union Ads', 'Video Ads', 'Search Engine', 'Baidu', 'Google', 'Bing', 'Others'] }, grid: { left: '3%', right: '4%', bottom: '3%', - containLabel: true, + containLabel: true }, xAxis: [ { type: 'category', - data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], - }, + data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] + } ], yAxis: [ { - type: 'value', - }, + type: 'value' + } ], series: [ { name: 'Direct', type: 'bar', emphasis: { - focus: 'series', + focus: 'series' }, - data: [320, 332, 301, 334, 390, 330, 320], + data: [320, 332, 301, 334, 390, 330, 320] }, { name: 'Email', type: 'bar', stack: 'Ad', emphasis: { - focus: 'series', + focus: 'series' }, - data: [120, 132, 101, 134, 90, 230, 210], + data: [120, 132, 101, 134, 90, 230, 210] }, { name: 'Union Ads', type: 'bar', stack: 'Ad', emphasis: { - focus: 'series', + focus: 'series' }, - data: [220, 182, 191, 234, 290, 330, 310], + data: [220, 182, 191, 234, 290, 330, 310] }, { name: 'Video Ads', type: 'bar', stack: 'Ad', emphasis: { - focus: 'series', + focus: 'series' }, - data: [150, 232, 201, 154, 190, 330, 410], + data: [150, 232, 201, 154, 190, 330, 410] }, { name: 'Search Engine', type: 'bar', data: [862, 1018, 964, 1026, 1679, 1600, 1570], emphasis: { - focus: 'series', + focus: 'series' }, markLine: { lineStyle: { - type: 'dashed', + type: 'dashed' }, - data: [[{ type: 'min' }, { type: 'max' }]], - }, + data: [[{ type: 'min' }, { type: 'max' }]] + } }, { name: 'Baidu', @@ -86,38 +86,38 @@ const Echarts = () => { barWidth: 5, stack: 'Search Engine', emphasis: { - focus: 'series', + focus: 'series' }, - data: [620, 732, 701, 734, 1090, 1130, 1120], + data: [620, 732, 701, 734, 1090, 1130, 1120] }, { name: 'Google', type: 'bar', stack: 'Search Engine', emphasis: { - focus: 'series', + focus: 'series' }, - data: [120, 132, 101, 134, 290, 230, 220], + data: [120, 132, 101, 134, 290, 230, 220] }, { name: 'Bing', type: 'bar', stack: 'Search Engine', emphasis: { - focus: 'series', + focus: 'series' }, - data: [60, 72, 71, 74, 190, 130, 110], + data: [60, 72, 71, 74, 190, 130, 110] }, { name: 'Others', type: 'bar', stack: 'Search Engine', emphasis: { - focus: 'series', + focus: 'series' }, - data: [62, 82, 91, 84, 109, 110, 120], - }, - ], + data: [62, 82, 91, 84, 109, 110, 120] + } + ] } return (
diff --git a/src/pages/home/index.jsx b/src/pages/home/index.jsx index d2fbda49..48763dd1 100644 --- a/src/pages/home/index.jsx +++ b/src/pages/home/index.jsx @@ -62,7 +62,7 @@ import { oneApiChat, prettyObject, // randomNum, - getDirection, + getDirection } from '@utils/aidFn' import { fireConfetti } from '@utils/confetti' import Zoom from 'react-medium-image-zoom' @@ -77,7 +77,7 @@ const code = { main : "This component needs more than the default code block to be displayed" detailed : "For now, if you want the exact same behaviour, please check the github" }`, - lang: 'typescript', + lang: 'typescript' } const preCode = ` @@ -95,20 +95,20 @@ const preCode = ` const dataSteps = [ { title: 'Step 1', - code: 'npx create-react-app my-app', + code: 'npx create-react-app my-app' }, { title: 'Step 2', - code: 'cd my-app', + code: 'cd my-app' }, { title: 'Step 3', - code: 'npm start', + code: 'npm start' }, { title: 'Step 4', - code: 'npm run build', - }, + code: 'npm run build' + } ] const Home = () => { @@ -189,8 +189,8 @@ const Home = () => { [ { content: text, - role: 'user', - }, + role: 'user' + } ], key, signal @@ -284,10 +284,10 @@ const Home = () => { @@ -295,14 +295,14 @@ const Home = () => { - + - + - {/*+ @@ -326,7 +326,7 @@ const Home = () => { width: 360, background: '#111827', position: 'relative', - overflow: 'hidden', + overflow: 'hidden' }} > @@ -314,7 +314,7 @@ const Home = () => { 'Loading awesome content', 'Almost there', 'Just a moment', - 'Getting things ready', + 'Getting things ready' ]} /> @@ -337,16 +337,16 @@ const Home = () => { fontSize: 20, height: 200, width: 360, - background: '#111827', + background: '#111827' }} > { height: 200, width: 360, overflow: 'hidden', - position: 'relative', + position: 'relative' }} - className="bg-slate-900" + className='bg-slate-900' > @@ -369,9 +369,9 @@ const Home = () => { height: 200, width: 360, overflow: 'hidden', - position: 'relative', + position: 'relative' }} - className="bg-slate-900" + className='bg-slate-900' >@@ -386,7 +386,7 @@ const Home = () => { display: 'flex', alignItems: 'center', justifyContent: 'center', - color: '#fff', + color: '#fff' }} > Direction: {enterDirection} @@ -395,29 +395,29 @@ const Home = () => { - + - + - -+ + @@ -430,13 +430,13 @@ const Home = () => { {/* React Animate On Scroll.
-
+ -
+ - + @@ -471,18 +471,18 @@ const Home = () => { */}- + - + <> - + @@ -491,16 +491,16 @@ const Home = () => {Mix Blend Mode >- + - - + + @@ -514,7 +514,7 @@ const Home = () => { height: 200, position: 'relative', backgroundColor: 'rgba(0, 0,0, 0.2)', - borderRadius: 8, + borderRadius: 8 }} > @@ -531,16 +531,16 @@ const Home = () => { - ✨
+✨
@@ -555,16 +555,16 @@ const Home = () => { mask - - - - - + + + + @@ -587,12 +587,12 @@ const Home = () => { - - + + @@ -643,21 +643,21 @@ const Home = () => { { } - type="primary" + type='primary' disabled={isStream} onClick={onSubmit} > 发送 - } type="primary" disabled={!isStream} onClick={onStop}> + } type='primary' disabled={!isStream} onClick={onStop}> 停止 @@ -665,7 +665,7 @@ const Home = () => { - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + -