Skip to content

Commit 4501910

Browse files
docs: remove build lint warnings
Amp-Thread-ID: https://ampcode.com/threads/T-01a08e2d-682f-75dd-a050-cb9bf8888dac Co-authored-by: Amp <amp@ampcode.com>
1 parent 3b6a4f8 commit 4501910

7 files changed

Lines changed: 15 additions & 18 deletions

File tree

pnpm-lock.yaml

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/api/og/[...path]/route.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ export async function GET(
4242
}}
4343
>
4444
{/* Sourcegraph logo */}
45-
<img src={logoDataUrl} width={246} height={35} />
45+
{/* eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text -- Satori requires a native image, and alt text is not rendered. */}
46+
<img src={logoDataUrl} width={246} height={35} alt="" />
4647

4748
{/* Title */}
4849
<div

src/components/ContentTabs.jsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ export function ContentTabs({ children, name }) {
1515
const [postContent, setPostContent] = useState(null);
1616

1717
useEffect(() => {
18-
updateTabFromURL();
19-
}, []);
20-
21-
const updateTabFromURL = () => {
22-
2318
const path = `/${params.slug.join('/')}`;
2419
const allPaths = children.map(child => child.props.href)
2520

@@ -38,7 +33,7 @@ export function ContentTabs({ children, name }) {
3833
console.log('allPaths__', allPaths[0])
3934
}
4035
} else setSelectedTab(path)
41-
};
36+
}, [children, name, params.slug]);
4237

4338
if (!onTab) return <div>{postContent}</div>
4439

src/components/Logo.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ export function Logo(props: React.ComponentPropsWithoutRef<'svg'>) {
33

44
return (
55
<>
6+
{/* eslint-disable-next-line @next/next/no-img-element -- SVG logos do not need image optimization. */}
67
<img
78
className="hidden h-[23px] w-[190px] dark:block"
89
src={`${basePath}/logo-theme-dark.svg`}
910
alt="Sourcegraph Docs"
1011
/>
12+
{/* eslint-disable-next-line @next/next/no-img-element -- SVG logos do not need image optimization. */}
1113
<img
1214
className="block h-[23px] w-[190px] dark:hidden"
1315
src={`${basePath}/logo-theme-light.svg`}

src/components/mdx/LinkCards.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export function LinkCard({
3131
<div className="not-prose group relative rounded-xl border border-light-border-2 dark:border-dark-border">
3232
<div className="absolute -inset-px rounded-xl border-2 border-transparent opacity-0 transition-opacity [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.light-bg)),var(--quick-links-hover-bg,theme(colors.light-bg-1)))_padding-box,linear-gradient(144deg,#F34E3F,#A96AF3)_border-box] group-hover:opacity-100 dark:[--quick-links-hover-bg:theme(colors.dark-bg)]" />
3333
<div className="relative flex items-center gap-4 overflow-hidden rounded-xl p-4 sm:gap-6">
34+
{/* eslint-disable-next-line @next/next/no-img-element -- Small MDX icons do not need image optimization. */}
3435
<img className="not-prose h-8 w-8" alt={imgAlt} src={imgSrc} />
3536
<div className="flex flex-col items-start gap-1">
3637
<h3 className="slate-900 font-display text-xl dark:text-white">

src/components/mdx/ProductCards.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export function ProductCard({
2828
<div className="group relative rounded-xl border border-light-border-2 dark:border-dark-border">
2929
<div className="absolute -inset-px rounded-xl border-2 border-transparent opacity-0 transition-opacity [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.light-bg)),var(--quick-links-hover-bg,theme(colors.light-bg-1)))_padding-box,linear-gradient(144deg,#F34E3F,#A96AF3)_border-box] group-hover:opacity-100 dark:[--quick-links-hover-bg:theme(colors.dark-bg)]" />
3030
<div className="relative flex flex-col items-start gap-y-4 overflow-hidden rounded-xl p-6">
31+
{/* eslint-disable-next-line @next/next/no-img-element -- Small MDX icons do not need image optimization. */}
3132
<img className="not-prose h-8 w-8" alt={imgAlt} src={imgSrc} />
3233
<div>
3334
<h2 className="font-display text-base text-slate-900 dark:text-white">

src/components/mdx/ZoomableImage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export function ZoomableImage({className, alt, ...props}: ZoomableImageProps) {
2828

2929
return (
3030
<>
31+
{/* eslint-disable-next-line @next/next/no-img-element -- MDX image dimensions are unknown. */}
3132
<img
3233
className={`cursor-zoom-in rounded-xl ${className ?? ''}`}
3334
alt={alt}
@@ -63,6 +64,7 @@ export function ZoomableImage({className, alt, ...props}: ZoomableImageProps) {
6364
<line x1="6" y1="6" x2="18" y2="18" />
6465
</svg>
6566
</button>
67+
{/* eslint-disable-next-line @next/next/no-img-element -- MDX image dimensions are unknown. */}
6668
<img
6769
className="max-h-[90vh] max-w-[90vw] cursor-zoom-out rounded-lg object-contain"
6870
alt={alt}

0 commit comments

Comments
 (0)