Skip to content

Rule · Lint

Page openGraph replaces the layout's (shallow merge drops images/siteName)

lint/og-merge-drops-parentwarnvoid lintupdated

Why it matters

Next merges metadata shallowly: when a page sets openGraph, the parent's whole openGraph object is replaced. Images, siteName, locale defined in the layout silently disappear from that page's link previews. Same for alternates (types, languages).

How to fix it

Spread shared fields back in (openGraph: { ...sharedOpenGraph, title }) or use file-based opengraph-image in the segment.

Example

ts
import { sharedOpenGraph } from '@/lib/seo'
export const metadata = { openGraph: { ...sharedOpenGraph, title: 'Pricing', url: '/pricing' } }

References

void lint reports 67 rules in this category. Static source checks with no browser: Tailwind v4 silent failures, Next.js 16 API traps, React render-body bugs, accessibility markup, SEO files and motion hygiene.