From 35a57346c7a3dd5a3129023b5fe36801fc6d3208 Mon Sep 17 00:00:00 2001 From: barsnes Date: Thu, 20 Jun 2024 09:34:21 +0200 Subject: [PATCH] more eslint disabled removed --- apps/theme/app/page.tsx | 10 +++++----- plugins/figma-plugin/src/ui/pages/PageOne/PageOne.tsx | 3 +-- plugins/figma-plugin/src/ui/pages/PageTwo/PageTwo.tsx | 3 --- .../figma-plugin/src/ui/pages/pageThree/PageThree.tsx | 3 --- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/apps/theme/app/page.tsx b/apps/theme/app/page.tsx index 80e8fb769a..adec18d1f7 100644 --- a/apps/theme/app/page.tsx +++ b/apps/theme/app/page.tsx @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/unbound-method */ -/* eslint-disable react-hooks/exhaustive-deps */ 'use client'; import { useEffect, useRef, useState } from 'react'; @@ -59,7 +57,7 @@ export default function Home() { const [themeMode, setThemeMode] = useState('light'); const [contrastMode, setContrastMode] = useState('aa'); - const { replace } = useRouter(); + const router = useRouter(); const searchParams = useSearchParams(); const pathname = usePathname(); const params = new URLSearchParams(searchParams); @@ -71,6 +69,7 @@ export default function Home() { if (theme) { setThemeMode(theme); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { @@ -101,6 +100,7 @@ export default function Home() { updateColor('brand1', queryBrand1, colors.brand1); updateColor('brand2', queryBrand2, colors.brand2); updateColor('brand3', queryBrand3, colors.brand3); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [contrastMode]); useEffect(() => { @@ -194,13 +194,13 @@ export default function Home() { if (color !== defaultColor[colorType]) { params.set(colorType, color); - replace(`${pathname}?${params.toString()}`, { scroll: false }); + router.replace(`${pathname}?${params.toString()}`, { scroll: false }); } }; const themeQuerySetter = (themeMode: Mode) => { params.set('theme', themeMode); - replace(`${pathname}?${params.toString()}`, { scroll: false }); + router.replace(`${pathname}?${params.toString()}`, { scroll: false }); }; /** diff --git a/plugins/figma-plugin/src/ui/pages/PageOne/PageOne.tsx b/plugins/figma-plugin/src/ui/pages/PageOne/PageOne.tsx index ee8c97a5bb..b6a32ddc72 100644 --- a/plugins/figma-plugin/src/ui/pages/PageOne/PageOne.tsx +++ b/plugins/figma-plugin/src/ui/pages/PageOne/PageOne.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ import { Heading, Paragraph, @@ -7,7 +6,7 @@ import { Button, Link, } from '@digdir/designsystemet-react'; -import React, { useState } from 'react'; +import { useState } from 'react'; import { Toast } from '@ui/components/Toast/Toast'; diff --git a/plugins/figma-plugin/src/ui/pages/PageTwo/PageTwo.tsx b/plugins/figma-plugin/src/ui/pages/PageTwo/PageTwo.tsx index 1c52599f5d..8035f14c4b 100644 --- a/plugins/figma-plugin/src/ui/pages/PageTwo/PageTwo.tsx +++ b/plugins/figma-plugin/src/ui/pages/PageTwo/PageTwo.tsx @@ -1,6 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import React from 'react'; - function PageTwo() { return
page two
; } diff --git a/plugins/figma-plugin/src/ui/pages/pageThree/PageThree.tsx b/plugins/figma-plugin/src/ui/pages/pageThree/PageThree.tsx index 48c3cab132..7bea6f9bf4 100644 --- a/plugins/figma-plugin/src/ui/pages/pageThree/PageThree.tsx +++ b/plugins/figma-plugin/src/ui/pages/pageThree/PageThree.tsx @@ -1,6 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import React from 'react'; - function PageThree() { return
page three
; }