Skip to content

Commit

Permalink
chore: update eslint.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Daydreamer-riri committed Jun 29, 2024
1 parent f9fcd0e commit 2b09e1f
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 15 deletions.
8 changes: 7 additions & 1 deletion docs/src/pages/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,20 @@ export default function Layout() {
>
Repo
</a>
<button title="Toggle Color Scheme" className="py-2 px-6 pl-2 op-60 hover:op-100" onClick={() => toggleTheme()}>
<button
type="button"
title="Toggle Color Scheme"
className="py-2 px-6 pl-2 op-60 hover:op-100"
onClick={() => toggleTheme()}
>
<div className="i-ri-sun-line dark:i-ri-moon-line"></div>
</button>
</nav>
<button
title="Menu"
className="sm:hidden flex flex-col ml-4"
onClick={() => setMenuOpen(!menuOpen)}
type="button"
>
<span className="w-6 h-1 bg-gray-800 dark:bg-white mb-1" />
<span className="w-6 h-1 bg-gray-800 dark:bg-white mb-1" />
Expand Down
5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ import ririd from '@ririd/eslint-config'

export default ririd({
formatters: true,
}, {
files: ['**/*.md/**/*.html'],
rules: {
'format/prettier': 'off',
},
})
7 changes: 6 additions & 1 deletion examples/auto-pages/src/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ export default function Layout() {
<Outlet />
</Suspense>
<div>
<button onClick={() => setState(v => !v)}>layout change title</button>
<button
onClick={() => setState(v => !v)}
type="button"
>
layout change title
</button>
</div>
</main>
</>
Expand Down
2 changes: 1 addition & 1 deletion examples/auto-pages/src/components/a-count.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function ACount({ onClick }: { onClick: (value: number) => void }
setCount(prev => ++prev)
onClick?.(count + 1)
}}

type="button"
>{count}
</button>
)
Expand Down
4 changes: 2 additions & 2 deletions examples/auto-pages/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export default function Index() {
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount(count => count + 1)}>
<button type="button" onClick={() => setCount(count => count + 1)}>
count is {count}
</button>
<button onClick={() => startTransition(() => void 0)}>
<button type="button" onClick={() => startTransition(() => void 0)}>
to A
</button>
<Link to="/a">TO A</Link>
Expand Down
2 changes: 1 addition & 1 deletion examples/lazy-pages/src/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function Layout() {
<Outlet />
</Suspense>
<div>
<button onClick={() => setState(v => !v)}>layout change title</button>
<button type="button" onClick={() => setState(v => !v)}>layout change title</button>
</div>
</main>
</>
Expand Down
8 changes: 7 additions & 1 deletion examples/lazy-pages/src/components/a-count.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ export default function ACount() {
const [count, setCount] = useState(0)

return (
<button className="a-count" onClick={() => setCount(prev => ++prev)}>{count}</button>
<button
type="button"
className="a-count"
onClick={() => setCount(prev => ++prev)}
>
{count}
</button>
)
}
2 changes: 1 addition & 1 deletion examples/lazy-pages/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Index() {
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount(count => count + 1)}>
<button type="button" onClick={() => setCount(count => count + 1)}>
count is {count}
</button>
<Link to="/a">TO A</Link>
Expand Down
2 changes: 1 addition & 1 deletion examples/multiple-pages/src/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function Layout() {
<Outlet />
</Suspense>
<div>
<button onClick={() => setState(v => !v)}>layout change title</button>
<button type="button" onClick={() => setState(v => !v)}>layout change title</button>
</div>
</main>
</>
Expand Down
8 changes: 7 additions & 1 deletion examples/multiple-pages/src/components/a-count.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ export default function ACount() {
const [count, setCount] = useState(0)

return (
<button className="a-count" onClick={() => setCount(prev => ++prev)}>{count}</button>
<button
type="button"
className="a-count"
onClick={() => setCount(prev => ++prev)}
>
{count}
</button>
)
}
2 changes: 1 addition & 1 deletion examples/multiple-pages/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Index() {
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount(count => count + 1)}>
<button type="button" onClick={() => setCount(count => count + 1)}>
count is {count}
</button>
<Link to="/a">TO A</Link>
Expand Down
2 changes: 1 addition & 1 deletion examples/single-page/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function Index() {
<h1>Vite + React</h1>
<h2>vite-react-ssg single-page</h2>
<div className="card">
<button onClick={() => setCount(count => count + 1)}>
<button type="button" onClick={() => setCount(count => count + 1)}>
count is {count}
</button>
<p>
Expand Down
7 changes: 6 additions & 1 deletion examples/styled-components/src/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ export default function Layout() {
<Outlet />
</Suspense>
<div>
<button onClick={() => setState(v => !v)}>layout change title</button>
<button
type="button"
onClick={() => setState(v => !v)}
>
layout change title
</button>
</div>
</main>
</>
Expand Down
4 changes: 2 additions & 2 deletions examples/styled-components/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export default function Index() {
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount(count => count + 1)}>
<button type="button" onClick={() => setCount(count => count + 1)}>
count is {count}
</button>
<button onClick={() => startTransition(() => void 0)}>
<button type="button" onClick={() => startTransition(() => void 0)}>
to A
</button>
<Link to="/a">TO A</Link>
Expand Down
1 change: 1 addition & 0 deletions examples/with-loader/src/pages/[docs].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default function Docs() {
const doc = useLoaderData() as string

return (
// eslint-disable-next-line react-dom/no-dangerously-set-innerhtml
<div dangerouslySetInnerHTML={{ __html: doc }} />
)
}
Expand Down

0 comments on commit 2b09e1f

Please sign in to comment.