Skip to content

Commit 8d72ac0

Browse files
committed
chore(eslint): update for new version
1 parent e26170e commit 8d72ac0

6 files changed

Lines changed: 13 additions & 8 deletions

File tree

eslint.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ export default antfu(
66
{
77
react: true,
88
nextjs: true,
9-
typescript: true,
9+
typescript: {
10+
tsconfigPath: 'tsconfig.json',
11+
},
1012

1113
// Configuration preferences
1214
lessOpinionated: true,
@@ -35,6 +37,7 @@ export default antfu(
3537
// --- Custom Rule Overrides ---
3638
{
3739
rules: {
40+
'react/no-implicit-key': 'off', // Fixes linting errors on configuration files
3841
'antfu/no-top-level-await': 'off', // Allow top-level await
3942
'style/brace-style': ['error', '1tbs'], // Use the default brace style
4043
'ts/consistent-type-definitions': ['error', 'type'], // Use `type` instead of `interface`

src/app/404/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import dynamic from 'next/dynamic';
22

3-
const NotFoundCanvas = dynamic(() => import('@/components/NotFoundCanvas'), {
3+
const NotFoundCanvas = dynamic(async () => import('@/components/NotFoundCanvas'), {
44
loading: () => <div style={{ height: '200px' }} />,
55
});
66

src/app/[[...mdxPath]]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type PageProps = Readonly<{
1616
}>;
1717
}>;
1818

19-
const Wrapper = getMDXComponents().wrapper;
19+
const Wrapper = getMDXComponents().wrapper!;
2020

2121
const Page: FC<PageProps> = async (props) => {
2222
const params = await props.params;

src/components/NotFoundCanvas.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default function NotFoundCanvas() {
121121
};
122122

123123
const drawScene = () => {
124-
if (requestRef.current) {
124+
if (requestRef.current !== undefined) {
125125
cancelAnimationFrame(requestRef.current);
126126
}
127127

@@ -157,7 +157,8 @@ export default function NotFoundCanvas() {
157157
for (let y = 0, y2 = data.height; y < y2; y = y + 4) {
158158
for (let x = 0, x2 = data.width; x < x2; x = x + 4) {
159159
const index = (y * 4 * data.width) + (x * 4) + 3;
160-
if (data.data[index] !== undefined && data.data[index]! > 128) {
160+
const pixelValue = data.data[index];
161+
if (pixelValue !== undefined && pixelValue > 128) {
161162
particlesRef.current.push(new Particle(x + padding, y + padding));
162163
}
163164
}
@@ -189,7 +190,7 @@ export default function NotFoundCanvas() {
189190
canvas.addEventListener('click', disperseParticlesMouse);
190191

191192
return () => {
192-
if (requestRef.current) {
193+
if (requestRef.current !== undefined) {
193194
cancelAnimationFrame(requestRef.current);
194195
}
195196
window.removeEventListener('resize', drawScene);

src/mdx-components.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ const docsComponents = getDocsMDXComponents({
99
QRCode,
1010
});
1111

12-
export const useMDXComponents: UseMDXComponents<typeof docsComponents> = (
12+
export const useMDXComponents: UseMDXComponents<MDXComponents> = (
1313
components?: MDXComponents,
1414
) => ({
1515
...docsComponents,
1616
...components,
17-
}) as any;
17+
});

src/theme.config.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ const config = {
159159
nextThemes: {
160160
defaultTheme: 'dark',
161161
},
162+
// eslint-disable-next-line react/no-unnecessary-use-prefix
162163
useNextSeoProps() {
163164
return {
164165
titleTemplate: '%s | ConnectBot',

0 commit comments

Comments
 (0)