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 (
-
+
我的中国心
-
+
我的中国心
-
+
我的中国心
-
+
我的中国心
-
+
我的中国心
-
+
我的中国心
diff --git a/src/components/container/musicPlayer/index.jsx b/src/components/container/musicPlayer/index.jsx index d1a951b6..2a717fa5 100644 --- a/src/components/container/musicPlayer/index.jsx +++ b/src/components/container/musicPlayer/index.jsx @@ -39,10 +39,10 @@ const MusicPlayer = () => { } return ( -
-
+
+
-
+
{ /> setSeekTime(event.target.value)} setSeekTime={setSeekTime} @@ -77,8 +77,8 @@ const MusicPlayer = () => {
setVolume(event.target.value)} setVolume={setVolume} /> diff --git a/src/components/stateless/CompareAll/index.jsx b/src/components/stateless/CompareAll/index.jsx index e34753bb..5c282dc0 100644 --- a/src/components/stateless/CompareAll/index.jsx +++ b/src/components/stateless/CompareAll/index.jsx @@ -14,7 +14,7 @@ const Compare = ({ slideMode = 'hover', showHandlebar = true, autoplay = false, - autoplayDuration = 5000, + autoplayDuration = 5000 }) => { const [sliderXPercent, setSliderXPercent] = useState(initialSliderPercentage) const [isDragging, setIsDragging] = useState(false) @@ -53,12 +53,12 @@ const Compare = ({ return () => stopAutoplay() }, [startAutoplay, stopAutoplay]) - function mouseEnterHandler() { + function mouseEnterHandler () { setIsMouseOver(true) stopAutoplay() } - function mouseLeaveHandler() { + function mouseLeaveHandler () { setIsMouseOver(false) if (slideMode === 'hover') { setSliderXPercent(initialSliderPercentage) @@ -133,7 +133,7 @@ const Compare = ({ className={clsx('w-[360px] h-[160px] overflow-hidden', className)} style={{ position: 'relative', - cursor: slideMode === 'drag' ? 'grab' : 'col-resize', + cursor: slideMode === 'drag' ? 'grab' : 'col-resize' }} onMouseMove={handleMouseMove} onMouseLeave={mouseLeaveHandler} @@ -146,57 +146,61 @@ const Compare = ({ > -
-
-
+
+
+
{showHandlebar && ( -
- +
+
)} -
+
- {firstImage ? ( - - first image - - ) : null} + {firstImage + ? ( + + first image + + ) + : null}
- {secondImage ? ( - - ) : null} + {secondImage + ? ( + + ) + : null}
) diff --git a/src/components/stateless/FeatureAny/TextComponent.jsx b/src/components/stateless/FeatureAny/TextComponent.jsx index a6584464..df07104a 100644 --- a/src/components/stateless/FeatureAny/TextComponent.jsx +++ b/src/components/stateless/FeatureAny/TextComponent.jsx @@ -11,7 +11,7 @@ const TextComponent = ({ number, title, content, isOpen, loadingWidthPercent }) : 'scale-90 border-transparent opacity-50 saturate-0' )} > -
+

-

{content}

-
-
+

{content}

+
+
{ @@ -46,17 +46,17 @@ const FeatureFourImages = () => { }, [timer]) return ( -
-
+
+
{data.map((item, index) => ( ))}
-
+
{data.map((item, index) => ( { return ( @@ -40,17 +40,17 @@ const HorizontalScrollParallax = () => { const Card = ({ card }) => { return ( -
+
-
-

+ className='absolute inset-0 z-0 transition-transform duration-300 group-hover:scale-110' + /> +

+

{card.title}

diff --git a/src/components/stateless/Meteors/index.jsx b/src/components/stateless/Meteors/index.jsx index 4cff14f4..cf1f205d 100644 --- a/src/components/stateless/Meteors/index.jsx +++ b/src/components/stateless/Meteors/index.jsx @@ -19,9 +19,9 @@ const Meteors = ({ number, className }) => { top: 0, left: Math.floor(Math.random() * (400 - -400) + -400) + 'px', animationDelay: Math.random() * (0.8 - 0.2) + 0.2 + 's', - animationDuration: Math.floor(Math.random() * (10 - 2) + 2) + 's', + animationDuration: Math.floor(Math.random() * (10 - 2) + 2) + 's' }} - > + /> ))} ) diff --git a/src/components/stateless/ShiCode/index.jsx b/src/components/stateless/ShiCode/index.jsx index 2f6d7161..75fba2ab 100644 --- a/src/components/stateless/ShiCode/index.jsx +++ b/src/components/stateless/ShiCode/index.jsx @@ -11,29 +11,31 @@ const ShiCode = ({ preCode }) => { } return ( -
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
Untitled
-
-
- {copyResult?.state === 'success' ? ( - - ) : ( - - )} +
+
+ {copyResult?.state === 'success' + ? ( + + ) + : ( + + )}
- + {({ style, tokens, getLineProps, getTokenProps }) => (
               {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 (
-    
-
-
    -
  • +
    +
    +
      +
    • '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
    -
    +
    ) } 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 ( -
    - +
    + {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: ( -
    +

    Product Tab

    - ), + ) }, { title: 'Services', value: 'services', content: ( -
    +

    Services tab

    - ), + ) }, { title: 'Playground', value: 'playground', content: ( -
    +

    Playground tab

    - ), + ) }, { title: 'Content', value: 'content', content: ( -
    +

    Content tab

    - ), + ) }, { title: 'Random', value: 'random', content: ( -
    +

    Random tab

    - ), - }, + ) + } ] const ProDemo = () => { return ( -
    +
    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 = () => {
    - +
    - +
    - +
    {/*
    @@ -314,7 +314,7 @@ const Home = () => { 'Loading awesome content', 'Almost there', 'Just a moment', - 'Getting things ready', + 'Getting things ready' ]} />
    @@ -326,7 +326,7 @@ const Home = () => { width: 360, background: '#111827', position: 'relative', - overflow: 'hidden', + overflow: 'hidden' }} > @@ -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 = () => {
    */}
    - +
    - +
    <> - +
    Mix Blend Mode
    @@ -491,16 +491,16 @@ const Home = () => { - +
    - -
    + +
    @@ -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 = () => {
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    @@ -665,7 +665,7 @@ const Home = () => {
    - +
    { textAlign: 'center', background: '#aaa', margin: '0 10px', - borderRadius: 8, + borderRadius: 8 // transform: 'rotateX(60deg) rotateY(0deg) rotateZ(45deg)' }} > @@ -683,7 +683,7 @@ const Home = () => {
    - +
    { textAlign: 'center', background: '#aaa', margin: '0 10px', - borderRadius: 8, + borderRadius: 8 }} > Vue diff --git a/src/pages/reactPdf/index.jsx b/src/pages/reactPdf/index.jsx index 2e6b5c27..9cb3c56d 100644 --- a/src/pages/reactPdf/index.jsx +++ b/src/pages/reactPdf/index.jsx @@ -7,12 +7,12 @@ import 'react-pdf/dist/esm/Page/TextLayer.css' // Set up the worker for react-pdf pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.mjs` -function ReactPdf() { +function ReactPdf () { const [numPages, setNumPages] = useState(null) const [pageNumber, setPageNumber] = useState(1) const [scale, setScale] = useState(1.0) - function onDocumentLoadSuccess({ numPages }) { + function onDocumentLoadSuccess ({ numPages }) { setNumPages(numPages) } @@ -26,39 +26,39 @@ function ReactPdf() { const httpsUrl = 'https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf' return ( -
    -
    -

    React PDF Viewer

    +
    +
    +

    React PDF Viewer

    -
    -
    - +
    +
    +
    -
    +
    -

    +

    Page {pageNumber} of {numPages}

    - -