Skip to content

Commit 54c8386

Browse files
committed
chore(eslint): update to v10
1 parent 3036b2d commit 54c8386

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+966
-1106
lines changed

apps/site/components/Common/FormattedTime.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ type FormattedTimeProps = {
1313
const FormattedTime: FC<FormattedTimeProps> = ({ date, format }) => {
1414
const formatter = useFormatter();
1515

16+
// "date" is deterministic
17+
// eslint-disable-next-line @eslint-react/purity
1618
const dateObject = new Date(date);
1719

1820
return (

apps/site/components/Common/Supporters/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ type SupportersListProps = {
1111

1212
const SupportersList: FC<SupportersListProps> = ({ supporters }) => (
1313
<div className="flex max-w-full flex-wrap items-center justify-center gap-1">
14-
{supporters.map(({ name, image, profile }, i) => (
14+
{supporters.map(({ name, image, profile }) => (
1515
<Avatar
1616
nickname={name}
1717
fallback={getAcronymFromString(name)}
1818
image={image}
19-
key={`${name}-${i}`}
19+
key={name}
2020
url={profile}
2121
/>
2222
))}

apps/site/components/Downloads/Release/BlogPostLink.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
'use client';
22

3-
import { useContext } from 'react';
3+
import { use } from 'react';
44

55
import Link from '#site/components/Link';
66
import { ReleaseContext } from '#site/providers/releaseProvider';
77

88
import type { FC, PropsWithChildren } from 'react';
99

1010
const BlogPostLink: FC<PropsWithChildren> = ({ children }) => {
11-
const { release } = useContext(ReleaseContext);
11+
const { release } = use(ReleaseContext);
1212
const version = release.versionWithPrefix;
1313

1414
return <Link href={`/blog/release/${version}`}>{children}</Link>;

apps/site/components/Downloads/Release/ChangelogLink.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { useContext } from 'react';
3+
import { use } from 'react';
44

55
import LinkWithArrow from '#site/components/Common/LinkWithArrow';
66
import { BASE_CHANGELOG_URL } from '#site/next.constants.mjs';
@@ -9,7 +9,7 @@ import { ReleaseContext } from '#site/providers/releaseProvider';
99
import type { FC, PropsWithChildren } from 'react';
1010

1111
const ChangelogLink: FC<PropsWithChildren> = ({ children }) => {
12-
const { release } = useContext(ReleaseContext);
12+
const { release } = use(ReleaseContext);
1313

1414
return (
1515
<LinkWithArrow href={`${BASE_CHANGELOG_URL}${release.version}`}>

apps/site/components/Downloads/Release/DownloadLink.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { useContext } from 'react';
3+
import { use } from 'react';
44

55
import DownloadLinkBase from '#site/components/Downloads/DownloadLink';
66
import { ReleaseContext } from '#site/providers/releaseProvider';
@@ -14,7 +14,7 @@ const DownloadLink: FC<PropsWithChildren<DownloadLinkProps>> = ({
1414
kind = 'installer',
1515
children,
1616
}) => {
17-
const { release } = useContext(ReleaseContext);
17+
const { release } = use(ReleaseContext);
1818

1919
return (
2020
<DownloadLinkBase release={release} kind={kind}>

apps/site/components/Downloads/Release/InstallationMethodDropdown.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import Select from '@node-core/ui-components/Common/Select';
44
import { useTranslations } from 'next-intl';
5-
import { useContext, useEffect, useMemo } from 'react';
5+
import { use, useEffect, useMemo } from 'react';
66

77
import { ReleaseContext } from '#site/providers/releaseProvider';
88
import { nextItem, INSTALL_METHODS, parseCompat } from '#site/util/download';
@@ -11,14 +11,14 @@ import type { InstallationMethod } from '#site/types/release';
1111
import type { FC } from 'react';
1212

1313
const InstallationMethodDropdown: FC = () => {
14-
const release = useContext(ReleaseContext);
14+
const release = use(ReleaseContext);
1515
const t = useTranslations();
1616

1717
// We parse the compatibility of the dropdown items
1818
const parsedInstallMethods = useMemo(
1919
() => parseCompat(INSTALL_METHODS, release),
2020
// We only want to react on the change of the OS and Version
21-
// eslint-disable-next-line react-hooks/exhaustive-deps
21+
// eslint-disable-next-line @eslint-react/exhaustive-deps
2222
[release.os, release.version]
2323
);
2424

@@ -36,7 +36,7 @@ const InstallationMethodDropdown: FC = () => {
3636
},
3737
],
3838
// We only want to react on the change of the parsedPlatforms
39-
// eslint-disable-next-line react-hooks/exhaustive-deps
39+
// eslint-disable-next-line @eslint-react/exhaustive-deps
4040
[parsedInstallMethods]
4141
);
4242

@@ -55,7 +55,7 @@ const InstallationMethodDropdown: FC = () => {
5555
// when the OS has finished loading for a given installation method
5656
release.setInstallMethod(installationMethod as InstallationMethod);
5757
}
58-
// eslint-disable-next-line react-hooks/exhaustive-deps
58+
// eslint-disable-next-line @eslint-react/exhaustive-deps
5959
}, [parsedInstallMethods, release.installMethod, release.os]);
6060

6161
// We set the Platform to the next available platform when the current
@@ -69,7 +69,7 @@ const InstallationMethodDropdown: FC = () => {
6969
}
7070
},
7171
// We only want to react on the change of the OS and Version
72-
// eslint-disable-next-line react-hooks/exhaustive-deps
72+
// eslint-disable-next-line @eslint-react/exhaustive-deps
7373
[release.os, release.version]
7474
);
7575

apps/site/components/Downloads/Release/OperatingSystemDropdown.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import Select from '@node-core/ui-components/Common/Select';
44
import { useTranslations } from 'next-intl';
5-
import { useContext, useEffect, useMemo } from 'react';
5+
import { use, useEffect, useMemo } from 'react';
66

7-
import { useClientContext } from '#site/hooks/client';
7+
import useClientContext from '#site/hooks/useClientContext';
88
import { ReleaseContext } from '#site/providers/releaseProvider';
99
import { nextItem, OPERATING_SYSTEMS, parseCompat } from '#site/util/download';
1010

@@ -15,7 +15,7 @@ type OperatingSystemDropdownProps = { exclude?: Array<OperatingSystem> };
1515

1616
const OperatingSystemDropdown: FC<OperatingSystemDropdownProps> = () => {
1717
const { os } = useClientContext();
18-
const release = useContext(ReleaseContext);
18+
const release = use(ReleaseContext);
1919
const t = useTranslations();
2020

2121
useEffect(() => {
@@ -25,14 +25,14 @@ const OperatingSystemDropdown: FC<OperatingSystemDropdownProps> = () => {
2525
// Reacts on Client Context change of OS
2626
// Only this Hook is allowed to bypass the `setOS` from above
2727
// As this Hook is what defined the initial OS state
28-
// eslint-disable-next-line react-hooks/exhaustive-deps
28+
// eslint-disable-next-line @eslint-react/exhaustive-deps
2929
}, [os]);
3030

3131
// We parse the compatibility of the dropdown items
3232
const parsedOperatingSystems = useMemo(
3333
() => parseCompat(OPERATING_SYSTEMS, release),
3434
// We only want to react on the change of the Install Method and Version
35-
// eslint-disable-next-line react-hooks/exhaustive-deps
35+
// eslint-disable-next-line @eslint-react/exhaustive-deps
3636
[release.installMethod, release.version]
3737
);
3838

@@ -45,7 +45,7 @@ const OperatingSystemDropdown: FC<OperatingSystemDropdownProps> = () => {
4545
}
4646
},
4747
// We only want to react on the change of the Version, Install Method and OS
48-
// eslint-disable-next-line react-hooks/exhaustive-deps
48+
// eslint-disable-next-line @eslint-react/exhaustive-deps
4949
[release.installMethod, release.version, release.os]
5050
);
5151

apps/site/components/Downloads/Release/PackageManagerDropdown.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import Select from '@node-core/ui-components/Common/Select';
44
import { useTranslations } from 'next-intl';
5-
import { useContext, useEffect, useMemo } from 'react';
5+
import { use, useEffect, useMemo } from 'react';
66

77
import { ReleaseContext } from '#site/providers/releaseProvider';
88
import { nextItem, PACKAGE_MANAGERS, parseCompat } from '#site/util/download';
@@ -11,14 +11,14 @@ import type { PackageManager } from '#site/types/release';
1111
import type { FC } from 'react';
1212

1313
const PackageManagerDropdown: FC = () => {
14-
const release = useContext(ReleaseContext);
14+
const release = use(ReleaseContext);
1515
const t = useTranslations();
1616

1717
// We parse the compatibility of the dropdown items
1818
const parsedPackageManagers = useMemo(
1919
() => parseCompat(PACKAGE_MANAGERS, release),
2020
// We only want to react on the change of the Version
21-
// eslint-disable-next-line react-hooks/exhaustive-deps
21+
// eslint-disable-next-line @eslint-react/exhaustive-deps
2222
[release.version]
2323
);
2424

@@ -30,7 +30,7 @@ const PackageManagerDropdown: FC = () => {
3030
nextItem(release.packageManager, parsedPackageManagers)
3131
),
3232
// We only want to react on the change of the Version
33-
// eslint-disable-next-line react-hooks/exhaustive-deps
33+
// eslint-disable-next-line @eslint-react/exhaustive-deps
3434
[release.version, release.packageManager]
3535
);
3636

apps/site/components/Downloads/Release/PlatformDropdown.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import Select from '@node-core/ui-components/Common/Select';
44
import { useTranslations } from 'next-intl';
5-
import { useEffect, useContext, useMemo } from 'react';
5+
import { useEffect, use, useMemo } from 'react';
66

7-
import { useClientContext } from '#site/hooks/client';
7+
import useClientContext from '#site/hooks/useClientContext';
88
import { ReleaseContext } from '#site/providers/releaseProvider';
99
import { PLATFORMS, nextItem, parseCompat } from '#site/util/download';
1010
import { getUserPlatform } from '#site/util/userAgent';
@@ -15,7 +15,7 @@ import type { FC } from 'react';
1515
const PlatformDropdown: FC = () => {
1616
const { architecture, bitness } = useClientContext();
1717

18-
const release = useContext(ReleaseContext);
18+
const release = use(ReleaseContext);
1919
const t = useTranslations();
2020

2121
useEffect(
@@ -27,7 +27,7 @@ const PlatformDropdown: FC = () => {
2727
}
2828
},
2929
// Only react on the change of the Client Context Architecture and Bitness
30-
// eslint-disable-next-line react-hooks/exhaustive-deps
30+
// eslint-disable-next-line @eslint-react/exhaustive-deps
3131
[architecture, bitness]
3232
);
3333

@@ -40,7 +40,7 @@ const PlatformDropdown: FC = () => {
4040
? parseCompat(PLATFORMS[release.os], release)
4141
: [],
4242
// We only want to react on the change of the OS, Platform, and Version
43-
// eslint-disable-next-line react-hooks/exhaustive-deps
43+
// eslint-disable-next-line @eslint-react/exhaustive-deps
4444
[release.os, release.version]
4545
);
4646

@@ -53,7 +53,7 @@ const PlatformDropdown: FC = () => {
5353
}
5454
},
5555
// We only want to react on the change of the OS and Version
56-
// eslint-disable-next-line react-hooks/exhaustive-deps
56+
// eslint-disable-next-line @eslint-react/exhaustive-deps
5757
[release.os, release.version, release.platform]
5858
);
5959

apps/site/components/Downloads/Release/PrebuiltDownloadButtons.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { CloudArrowDownIcon } from '@heroicons/react/24/outline';
44
import Skeleton from '@node-core/ui-components/Common/Skeleton';
55
import { useTranslations } from 'next-intl';
6-
import { useContext } from 'react';
6+
import { use } from 'react';
77

88
import Button from '#site/components/Common/Button';
99
import { ReleaseContext } from '#site/providers/releaseProvider';
@@ -20,7 +20,7 @@ const getExtension = (input: string) => String(input.split('.').slice(-1));
2020

2121
const PrebuiltDownloadButtons: FC = () => {
2222
const t = useTranslations();
23-
const { release, os, platform } = useContext(ReleaseContext);
23+
const { release, os, platform } = use(ReleaseContext);
2424

2525
const installerUrl = platform
2626
? getNodeDownloadUrl({

0 commit comments

Comments
 (0)