Skip to content

Commit b1306b2

Browse files
louis-preclaude
andcommitted
Fix eslint no-non-null-assertion errors in config.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent eeb29ee commit b1306b2

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

codegen/lib/config.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@ export const siteSections: SiteSection[] = [
2626
]
2727

2828
// Convenience accessors (used by codegen)
29-
export const guidesRoot = siteSections[0]!.root
30-
export const apiReferenceRoot = siteSections[1]!.root
31-
export const apiReferenceUrlPrefix = siteSections[1]!.urlPrefix
29+
const guides = siteSections.find((s) => s.name === 'Guides')
30+
const apiReference = siteSections.find((s) => s.name === 'API Reference')
31+
32+
if (guides == null || apiReference == null) {
33+
throw new Error('Missing required site section in config')
34+
}
35+
36+
export const guidesRoot = guides.root
37+
export const apiReferenceRoot = apiReference.root
38+
export const apiReferenceUrlPrefix = apiReference.urlPrefix
3239

3340
// Derived paths
3441
export const apiReferenceSummaryPath = join(apiReferenceRoot, 'SUMMARY.md')

0 commit comments

Comments
 (0)