Skip to content

Commit

Permalink
style: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Daydreamer-riri committed Jul 21, 2024
1 parent a596ff4 commit 34fc148
Show file tree
Hide file tree
Showing 13 changed files with 411 additions and 365 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ function Demo() {

return shouldMount
? (
<div
style={{
transition: 'opacity 0.3s',
opacity: (status === 'entering' || status === 'entered')
? 1
: 0,
}}
>
Hello Word
</div>
<div
style={{
transition: 'opacity 0.3s',
opacity: (status === 'entering' || status === 'entered')
? 1
: 0,
}}
>
Hello Word
</div>
)
: null
}
Expand Down Expand Up @@ -74,7 +74,8 @@ function Demo() {
exit: 'translateX(100%)',
}[simpleStatus]
}}
>{count}
>
{count}
</p>
))}
</div>
Expand Down
3 changes: 2 additions & 1 deletion docs/components/BasicUseSwitchTransition/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export function BasicUseSwitchTransition() {
}px)`,
position: 'absolute',
}}
>{text}
>
{text}
</Button>
))}
</div>
Expand Down
16 changes: 8 additions & 8 deletions docs/components/BasicUseTransition/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export function BasicUseTransition() {
<div>
{shouldMount
? (
<div
style={{
transition: 'opacity 0.3s',
opacity: status === 'entering' || status === 'entered' ? 1 : 0,
}}
>
Hello Word
</div>
<div
style={{
transition: 'opacity 0.3s',
opacity: status === 'entering' || status === 'entered' ? 1 : 0,
}}
>
Hello Word
</div>
)
: null}
<Button onClick={() => setShow(!show)}>toggle</Button>
Expand Down
34 changes: 17 additions & 17 deletions docs/pages/docs/SwitchTransition.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
## Example

```tsx
<SwitchTransition state={count} timeout={300} mode="default">
{(state, { simpleStatus }) => (
<h1
style={{
transition: '.3s',
opacity: simpleStatus === 'enter' ? 1 : 0,
transform: {
from: 'translateX(-100%) scale(1.2)',
enter: 'translateX(0)',
leave: 'translateX(100%) scale(0)',
}[simpleStatus],
}}
>
{state} {simpleStatus} hello
</h1>
)}
</SwitchTransition>
<SwitchTransition state={count} timeout={300} mode="default">
{(state, { simpleStatus }) => (
<h1
style={{
transition: '.3s',
opacity: simpleStatus === 'enter' ? 1 : 0,
transform: {
from: 'translateX(-100%) scale(1.2)',
enter: 'translateX(0)',
leave: 'translateX(100%) scale(0)',
}[simpleStatus],
}}
>
{state} {simpleStatus} hello
</h1>
)}
</SwitchTransition>
```

## Type
Expand Down
20 changes: 10 additions & 10 deletions docs/pages/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ export function BasicUseTransition() {
<div>
{shouldMount
? (
<div
style={{
transition: 'opacity 0.3s',
opacity: (status === 'entering' || status === 'entered')
? 1
: 0,
}}
>
Hello Word
</div>
<div
style={{
transition: 'opacity 0.3s',
opacity: (status === 'entering' || status === 'entered')
? 1
: 0,
}}
>
Hello Word
</div>
)
: null}
<button onClick={() => setShow(!show)}>toggle</button>

Check warning on line 47 in docs/pages/docs/index.mdx

View workflow job for this annotation

GitHub Actions / lint

Add missing 'type' attribute on 'button' component
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/docs/useSwitchTransition.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export function BasicUseSwitchTransition() {
}px)`,
position: 'absolute',
}}
>{text}
>
{text}
</Button>
))}
</div>
Expand Down
20 changes: 10 additions & 10 deletions docs/pages/docs/useTransition.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ export function BasicUseTransition() {
<div>
{shouldMount // [!code focus]
? (
<div
style={{
transition: 'opacity 0.3s',
opacity: (status === 'entering' || status === 'entered') // [!code focus]
? 1 // [!code focus]
: 0, // [!code focus]
}}
>
Hello Word
</div>
<div
style={{
transition: 'opacity 0.3s',
opacity: (status === 'entering' || status === 'entered') // [!code focus]
? 1 // [!code focus]
: 0, // [!code focus]
}}
>
Hello Word
</div>
)
: null}
<button onClick={() => setShow(!show)}>toggle</button>

Check warning on line 37 in docs/pages/docs/useTransition.mdx

View workflow job for this annotation

GitHub Actions / lint

Add missing 'type' attribute on 'button' component
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.24",
"bumpp": "^9.4.0",
"eslint": "^9.7.0",
"eslint": "^8.57.0",
"esno": "^4.7.0",
"lint-staged": "15.2.2",
"react": "^18.2.0",
Expand Down
Loading

0 comments on commit 34fc148

Please sign in to comment.