Skip to content

Commit

Permalink
more eslint disabled removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsnes committed Jun 20, 2024
1 parent 60275b7 commit 35a5734
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
10 changes: 5 additions & 5 deletions apps/theme/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable react-hooks/exhaustive-deps */
'use client';

import { useEffect, useRef, useState } from 'react';
Expand Down Expand Up @@ -59,7 +57,7 @@ export default function Home() {
const [themeMode, setThemeMode] = useState<Mode>('light');
const [contrastMode, setContrastMode] = useState<ContrastMode>('aa');

const { replace } = useRouter();
const router = useRouter();
const searchParams = useSearchParams();
const pathname = usePathname();
const params = new URLSearchParams(searchParams);
Expand All @@ -71,6 +69,7 @@ export default function Home() {
if (theme) {
setThemeMode(theme);
}
// eslint-disable-next-line react-hooks/exhaustive-deps

Check warning on line 72 in apps/theme/app/page.tsx

View workflow job for this annotation

GitHub Actions / Builds, lints and tests code

React Compiler has skipped optimizing this component because one or more React ESLint rules were disabled. React Compiler only works when your components follow all the rules of React, disabling them may result in unexpected or incorrect behavior
}, []);

useEffect(() => {
Expand Down Expand Up @@ -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

Check warning on line 103 in apps/theme/app/page.tsx

View workflow job for this annotation

GitHub Actions / Builds, lints and tests code

React Compiler has skipped optimizing this component because one or more React ESLint rules were disabled. React Compiler only works when your components follow all the rules of React, disabling them may result in unexpected or incorrect behavior
}, [contrastMode]);

useEffect(() => {
Expand Down Expand Up @@ -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 });
};

/**
Expand Down
3 changes: 1 addition & 2 deletions plugins/figma-plugin/src/ui/pages/PageOne/PageOne.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import {
Heading,
Paragraph,
Expand All @@ -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';

Expand Down
3 changes: 0 additions & 3 deletions plugins/figma-plugin/src/ui/pages/PageTwo/PageTwo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import React from 'react';

function PageTwo() {
return <div className='content'>page two</div>;
}
Expand Down
3 changes: 0 additions & 3 deletions plugins/figma-plugin/src/ui/pages/pageThree/PageThree.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import React from 'react';

function PageThree() {
return <div className='content'>page three</div>;
}
Expand Down

0 comments on commit 35a5734

Please sign in to comment.