Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format code with Prettier and StandardJS #527

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/layout/proSecNav/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'

Check failure on line 1 in src/pages/layout/proSecNav/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

ESLint

ESLint: Install the 'eslint' package
import { Menu } from 'antd'
import { useNavigate, useLocation } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
Expand Down Expand Up @@ -43,9 +43,9 @@
const [rootSubmenuKeys] = useState(['/sub-act', '/sub-list', '/sub-error'])

useEffect(() => {
const selectedPathKey = pathname

Check warning on line 46 in src/pages/layout/proSecNav/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Redundant local variable

Local variable selectedPathKey is redundant
setSelectedKeys([selectedPathKey])
setOpenKeys(isOpenChange ? openKeys : (pathSubmenu[pathname] ?? openKeys))
setOpenKeys(isOpenChange ? openKeys : pathSubmenu[pathname] ?? openKeys)
}, [pathname, openKeys, isOpenChange])

const onOpenChange = (keys) => {
Expand Down
39 changes: 18 additions & 21 deletions src/pages/motion/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useRef } from 'react'

Check failure on line 1 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

ESLint

ESLint: Install the 'eslint' package
import { motion, useAnimationControls, LayoutGroup } from 'motion/react'
import FixTabPanel from '@stateless/FixTabPanel'
import { is } from '@react-spring/shared'

Check warning on line 4 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused import

Unused import { is } from '@react-spring/shared'
Expand Down Expand Up @@ -59,7 +59,7 @@
]

const randomSort = (arr) => {
let newArr = []
const newArr = []
const len = arr.length
for (let i = 0; i < len; i++) {
const random = Math.floor(Math.random() * arr.length)
Expand Down Expand Up @@ -95,7 +95,7 @@
<FixTabPanel>
<h2>Hi, Motion</h2>

<motion.div

Check notice on line 98 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand All @@ -118,8 +118,8 @@
rotate: 45, // 旋转45度
opacity: 0.5, // 不透明度设置为0.5
}}
></motion.div>
/>
<motion.div

Check notice on line 122 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
transformTemplate={template}
animate={{ rotate: 360 }}
style={{
Expand All @@ -130,9 +130,9 @@
rotate: 0,
x: '200px',
}}
></motion.div>
/>

<motion.div

Check notice on line 135 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand All @@ -143,10 +143,10 @@
duration: 2,
}}
variants={animations}
initial={'hidden'}
animate={'show'}
></motion.div>
initial="hidden"
animate="show"
/>
<motion.ul

Check notice on line 149 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.ul
initial="hidden"
animate="visible"
variants={list}
Expand All @@ -157,12 +157,12 @@
}}
style={{ fontSize: 20 }}
>
<motion.li variants={item}>item1</motion.li>

Check notice on line 160 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.li
<motion.li variants={item}>item2</motion.li>

Check notice on line 161 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.li
<motion.li variants={item}>item3</motion.li>

Check notice on line 162 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.li
</motion.ul>
{['vue', 'react', 'angular'].map((item, i) => (
<motion.p style={{ fontSize: 20 }} key={i} custom={i + 0.3} animate="visible" variants={variantsText}>

Check notice on line 165 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.p
{item}
</motion.p>
))}
Expand All @@ -174,7 +174,7 @@
gap: 30,
}}
>
<motion.div

Check notice on line 177 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand All @@ -196,7 +196,7 @@
onClick={() => {
setRotate(!isRotated)
}}
></motion.div>
/>
<div
style={{
display: 'flex',
Expand All @@ -219,7 +219,7 @@
</div>
</div>

<motion.div

Check notice on line 222 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
display: 'flex',
flexDirection: 'column',
Expand All @@ -233,7 +233,7 @@
}}
ref={constraintsRef}
>
<motion.div

Check notice on line 236 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand All @@ -250,20 +250,17 @@
onDragStart={(event, info) => console.log(info.point.x, info.point.y)}
onDragEnd={(event, info) => console.log(info.point.x, info.point.y)}
onDirectionLock={(axis) => console.log('axis', axis)}
dragSnapToOrigin={true}
dragSnapToOrigin
// dragConstraints={{ left: 0, right: 300 }}
dragConstraints={constraintsRef}
// dragElastic={false}
// dragElastic={0.8}
// dragPropagation={false}
></motion.div>
/>
<div
style={{
display: 'flex',
gap: 20,
}}
>
<motion.div

Check notice on line 263 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={btnStyle}
onTap={() => {
controller.start({ scale: 1.2 })
Expand All @@ -271,7 +268,7 @@
>
</motion.div>
<motion.div

Check notice on line 271 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={btnStyle}
onTap={() => {
controller.start({ rotate: 45 })
Expand All @@ -279,7 +276,7 @@
>
旋转
</motion.div>
<motion.div

Check notice on line 279 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={btnStyle}
onClick={() => {
controller.start({ opacity: 0.2 })
Expand All @@ -287,7 +284,7 @@
>
透明度
</motion.div>
<motion.div

Check notice on line 287 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={btnStyle}
onTap={() => {
controller.start({ opacity: 1, rotate: 0, scale: 1.0 })
Expand All @@ -307,7 +304,7 @@
gap: 52,
}}
>
<motion.div

Check notice on line 307 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand All @@ -333,14 +330,14 @@
setIsAnimation(false)
console.log('Completed animating', definition)
}}
></motion.div>
/>
<div
style={{
display: 'flex',
gap: 20,
}}
>
<motion.div

Check notice on line 340 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
...btnStyle,
pointerEvents: isAnimation ? 'none' : 'auto',
Expand Down Expand Up @@ -392,7 +389,7 @@
}}
key={i}
>
<motion.div

Check notice on line 392 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand Down Expand Up @@ -452,7 +449,7 @@
marginTop: 30,
}}
>
<motion.div

Check notice on line 452 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 100,
height: 100,
Expand All @@ -466,10 +463,10 @@
duration: 1,
repeat: Infinity,
}}
></motion.div>
/>
</div>

<motion.div

Check notice on line 469 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 180,
backgroundColor: '#333',
Expand All @@ -483,7 +480,7 @@
setButtonState(!buttonRight)
}}
>
<motion.div

Check notice on line 483 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout // 设置在白色圆球元素上,即子元素上 <-
style={{
width: 60,
Expand All @@ -491,7 +488,7 @@
backgroundColor: 'white',
borderRadius: 60,
}}
></motion.div>
/>
</motion.div>

<div
Expand All @@ -505,7 +502,7 @@
fontWeight: 'bold',
}}
>
<motion.div

Check notice on line 505 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
display: 'flex',
flexDirection: 'column',
Expand All @@ -515,7 +512,7 @@
>
{listLabel.map((item) => {
return (
<motion.div

Check notice on line 515 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout
style={{
width: 200,
Expand All @@ -532,7 +529,7 @@
</motion.div>
)
})}
<motion.div

Check notice on line 532 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 160,
height: 50,
Expand Down Expand Up @@ -567,7 +564,7 @@
fontSize: 16,
}}
>
<motion.div

Check notice on line 567 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: buttonRight ? 160 : 200,
height: 40,
Expand All @@ -582,9 +579,9 @@
onTap={() => {
setButtonState(!buttonRight)
}}
></motion.div>
/>

<motion.div

Check notice on line 584 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 120,
height: 40,
Expand All @@ -602,7 +599,7 @@
onTap={() => {
setButtonState(!buttonRight)
}}
></motion.div>
/>
<span
style={{
color: '#aaa',
Expand All @@ -620,7 +617,7 @@
alignItems: 'center',
}}
>
<motion.div

Check notice on line 620 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
backgroundColor: '#333',
borderRadius: '10px',
Expand All @@ -633,7 +630,7 @@
layout
>
<LayoutGroup>
<motion.div

Check notice on line 633 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout
style={{
width: isBig ? 200 : 60,
Expand All @@ -651,9 +648,9 @@
setBigState(!isBig)
}}
>
<motion.span layout>click</motion.span>

Check notice on line 651 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.span
</motion.div>
<motion.div

Check notice on line 653 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout
style={{
width: 60,
Expand All @@ -661,8 +658,8 @@
backgroundColor: '#fff',
borderRadius: 10,
}}
></motion.div>
/>
<motion.div

Check notice on line 662 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout
style={{
width: 60,
Expand All @@ -670,7 +667,7 @@
backgroundColor: '#fff',
borderRadius: 10,
}}
></motion.div>
/>
</LayoutGroup>
</motion.div>
</div>
Expand All @@ -694,7 +691,7 @@
letterSpacing: 2,
}}
>
<motion.div

Check notice on line 694 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout
style={{
width: leftState ? 200 : 100,
Expand All @@ -710,7 +707,7 @@
setLeftState(!leftState)
}}
>
<motion.div

Check notice on line 710 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout
style={{
width: 30,
Expand All @@ -718,9 +715,9 @@
backgroundColor: 'black',
borderRadius: 60,
}}
></motion.div>
/>
</motion.div>
<motion.span layout>黑点和文字都设置了layout</motion.span>

Check notice on line 720 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.span
</div>
<div
style={{
Expand All @@ -733,7 +730,7 @@
color: '#333',
}}
>
<motion.div

Check notice on line 733 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
layout
style={{
width: leftState ? 200 : 100,
Expand All @@ -749,16 +746,16 @@
setLeftState(!leftState)
}}
>
<motion.div

Check notice on line 749 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.div
style={{
width: 30,
height: 30,
backgroundColor: 'black',
borderRadius: 60,
}}
></motion.div>
/>
</motion.div>
<motion.span>黑点和文字都未设置layout</motion.span>

Check notice on line 758 in src/pages/motion/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unresolved JSX component

Unresolved component motion.span
</div>
</div>
</FixTabPanel>
Expand Down
Loading