Skip to content

Commit 23954d9

Browse files
committed
chore(eslint): update to v10
1 parent 8ac227f commit 23954d9

Some content is hidden

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

52 files changed

+851
-1637
lines changed

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: 2 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,13 @@ 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
2221
[release.os, release.version]
2322
);
2423

@@ -36,7 +35,6 @@ const InstallationMethodDropdown: FC = () => {
3635
},
3736
],
3837
// We only want to react on the change of the parsedPlatforms
39-
// eslint-disable-next-line react-hooks/exhaustive-deps
4038
[parsedInstallMethods]
4139
);
4240

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

6158
// We set the Platform to the next available platform when the current
@@ -69,7 +66,6 @@ const InstallationMethodDropdown: FC = () => {
6966
}
7067
},
7168
// We only want to react on the change of the OS and Version
72-
// eslint-disable-next-line react-hooks/exhaustive-deps
7369
[release.os, release.version]
7470
);
7571

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

Lines changed: 3 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,12 @@ 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
2928
}, [os]);
3029

3130
// We parse the compatibility of the dropdown items
3231
const parsedOperatingSystems = useMemo(
3332
() => parseCompat(OPERATING_SYSTEMS, release),
3433
// We only want to react on the change of the Install Method and Version
35-
// eslint-disable-next-line react-hooks/exhaustive-deps
3634
[release.installMethod, release.version]
3735
);
3836

@@ -45,7 +43,6 @@ const OperatingSystemDropdown: FC<OperatingSystemDropdownProps> = () => {
4543
}
4644
},
4745
// We only want to react on the change of the Version, Install Method and OS
48-
// eslint-disable-next-line react-hooks/exhaustive-deps
4946
[release.installMethod, release.version, release.os]
5047
);
5148

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

Lines changed: 2 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,13 @@ 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
2221
[release.version]
2322
);
2423

@@ -30,7 +29,6 @@ const PackageManagerDropdown: FC = () => {
3029
nextItem(release.packageManager, parsedPackageManagers)
3130
),
3231
// We only want to react on the change of the Version
33-
// eslint-disable-next-line react-hooks/exhaustive-deps
3432
[release.version, release.packageManager]
3533
);
3634

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

Lines changed: 3 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,6 @@ 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
3130
[architecture, bitness]
3231
);
3332

@@ -40,7 +39,6 @@ const PlatformDropdown: FC = () => {
4039
? parseCompat(PLATFORMS[release.os], release)
4140
: [],
4241
// We only want to react on the change of the OS, Platform, and Version
43-
// eslint-disable-next-line react-hooks/exhaustive-deps
4442
[release.os, release.version]
4543
);
4644

@@ -53,7 +51,6 @@ const PlatformDropdown: FC = () => {
5351
}
5452
},
5553
// We only want to react on the change of the OS and Version
56-
// eslint-disable-next-line react-hooks/exhaustive-deps
5754
[release.os, release.version, release.platform]
5855
);
5956

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({

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { highlightToHtml } from '@node-core/rehype-shiki/minimal';
44
import AlertBox from '@node-core/ui-components/Common/AlertBox';
55
import Skeleton from '@node-core/ui-components/Common/Skeleton';
66
import { useTranslations } from 'next-intl';
7-
import { useContext, useMemo } from 'react';
7+
import { use, useMemo } from 'react';
88

99
import CodeBox from '#site/components/Common/CodeBox';
1010
import LinkWithArrow from '#site/components/Common/LinkWithArrow';
@@ -114,8 +114,8 @@ const usePlatformInfo = (installMethod: string) => {
114114
* ReleaseCodeBox component displays installation instructions based on platform and context
115115
*/
116116
const ReleaseCodeBox: FC = () => {
117-
const { snippets } = useContext(ReleasesContext);
118-
const context = useContext(ReleaseContext);
117+
const { snippets } = use(ReleasesContext);
118+
const context = use(ReleaseContext);
119119
const t = useTranslations();
120120

121121
// Process platform information
@@ -164,6 +164,7 @@ const ReleaseCodeBox: FC = () => {
164164
{/* Code display with skeleton loading */}
165165
<Skeleton loading={isLoading}>
166166
<CodeBox language={displayLanguage} className="min-h-[19rem]">
167+
{/* eslint-disable-next-line @eslint-react/dom/no-dangerously-set-innerhtml */}
167168
<code dangerouslySetInnerHTML={{ __html: parsedSnippets }} />
168169
</CodeBox>
169170
</Skeleton>

0 commit comments

Comments
 (0)