Skip to content

Commit bf99f6d

Browse files
ci: apply automated fixes
1 parent 2012267 commit bf99f6d

3 files changed

Lines changed: 22 additions & 9 deletions

File tree

src/components/markdown/MarkdownFrameworkHandler.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ import type { HTMLReactParserOptions } from 'html-react-parser'
44

55
// Helper to resolve different module shapes (named export vs default)
66
function resolveModuleDefault(mod: any, key: string): React.ComponentType<any> {
7-
if (!mod) return (undefined as any)
7+
if (!mod) return undefined as any
88
if (mod[key] && typeof mod[key] === 'function') return mod[key]
99
if (mod.default) {
10-
if (mod.default[key] && typeof mod.default[key] === 'function') return mod.default[key]
10+
if (mod.default[key] && typeof mod.default[key] === 'function')
11+
return mod.default[key]
1112
if (typeof mod.default === 'function') return mod.default
1213
}
1314
if (typeof mod === 'function') return mod
1415
return (mod as any).default ?? (mod as any)
1516
}
1617

1718
const FrameworkContent = React.lazy<React.ComponentType<any>>(() =>
18-
import('./FrameworkContent').then((mod) => ({ default: resolveModuleDefault(mod, 'FrameworkContent') })),
19+
import('./FrameworkContent').then((mod) => ({
20+
default: resolveModuleDefault(mod, 'FrameworkContent'),
21+
})),
1922
)
2023

2124
export function handleFrameworkComponent(

src/components/markdown/MarkdownTabsHandler.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,31 @@ import type { Framework } from '~/libraries/types'
55

66
// Helper to resolve different module shapes (named export vs default)
77
function resolveModuleDefault(mod: any, key: string): React.ComponentType<any> {
8-
if (!mod) return (undefined as any)
8+
if (!mod) return undefined as any
99
if (mod[key] && typeof mod[key] === 'function') return mod[key]
1010
if (mod.default) {
11-
if (mod.default[key] && typeof mod.default[key] === 'function') return mod.default[key]
11+
if (mod.default[key] && typeof mod.default[key] === 'function')
12+
return mod.default[key]
1213
if (typeof mod.default === 'function') return mod.default
1314
}
1415
if (typeof mod === 'function') return mod
1516
return (mod as any).default ?? (mod as any)
1617
}
1718

1819
const Tabs = React.lazy<React.ComponentType<any>>(() =>
19-
import('./Tabs').then((mod) => ({ default: resolveModuleDefault(mod, 'Tabs') })),
20+
import('./Tabs').then((mod) => ({
21+
default: resolveModuleDefault(mod, 'Tabs'),
22+
})),
2023
)
2124
const PackageManagerTabs = React.lazy<React.ComponentType<any>>(() =>
22-
import('./PackageManagerTabs').then((mod) => ({ default: resolveModuleDefault(mod, 'PackageManagerTabs') })),
25+
import('./PackageManagerTabs').then((mod) => ({
26+
default: resolveModuleDefault(mod, 'PackageManagerTabs'),
27+
})),
2328
)
2429
const FileTabs = React.lazy<React.ComponentType<any>>(() =>
25-
import('./FileTabs').then((mod) => ({ default: resolveModuleDefault(mod, 'FileTabs') })),
30+
import('./FileTabs').then((mod) => ({
31+
default: resolveModuleDefault(mod, 'FileTabs'),
32+
})),
2633
)
2734

2835
export function handleTabsComponent(

src/components/markdown/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
export { Markdown } from './Markdown'
22
export { MarkdownLink } from './MarkdownLink'
33
export { MarkdownContent } from './MarkdownContent'
4-
export { MarkdownHeadingProvider, useMarkdownHeadings } from './MarkdownHeadingContext'
4+
export {
5+
MarkdownHeadingProvider,
6+
useMarkdownHeadings,
7+
} from './MarkdownHeadingContext'
58
export { CodeBlock } from './CodeBlock'
69
export { Tabs } from './Tabs'
710
export { FileTabs } from './FileTabs'

0 commit comments

Comments
 (0)