Skip to content

Commit 07f9946

Browse files
authored
chore(typescript): enable strict mode (#4690)
1 parent fd7d120 commit 07f9946

26 files changed

Lines changed: 274 additions & 126 deletions

File tree

src/components/global/BestPracticeFigure/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { type ReactNode } from 'react';
22

33
import './best-practice-figure.css';
44

@@ -54,6 +54,14 @@ export default function BestPracticeFigure({
5454
doImage,
5555
doNotImage,
5656
cautionImage,
57+
}: {
58+
text: ReactNode;
59+
doText: ReactNode;
60+
doNotText?: ReactNode;
61+
cautionText?: ReactNode;
62+
doImage: ReactNode;
63+
doNotImage?: ReactNode;
64+
cautionImage?: ReactNode;
5765
}) {
5866
return (
5967
<div className="best-practice__container">

src/components/global/Codepen/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ import React, { type ReactNode } from 'react';
22

33
import { useScript } from '@site/src/utils/hooks';
44

5-
function CodePen(props): ReactNode {
5+
function CodePen(props: {
6+
height?: number | string;
7+
theme?: string;
8+
defaultTab?: string;
9+
user?: string;
10+
slug?: string;
11+
preview?: boolean;
12+
penTitle?: string;
13+
}): ReactNode {
614
const status = useScript('https://static.codepen.io/assets/embed/ei.js');
715
// console.log('test',status, props)
816
return (

src/components/global/DocsCard/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ function DocsCard(props: Props): ReactNode {
5353
</>
5454
);
5555

56-
const className = clsx({
56+
const className = clsx(props.className, {
5757
'Card-with-image': typeof props.img !== 'undefined',
5858
'Card-without-image': typeof props.img === 'undefined',
5959
'Card-size-lg': props.size === 'lg',
60-
[props.className]: props.className,
6160
});
6261

6362
if (isStatic) {

src/components/global/DocsCards/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { type ReactNode } from 'react';
22

33
import './cards.css';
44

5-
function DocsCards(props): ReactNode {
5+
function DocsCards(props: { className?: string; children?: ReactNode }): ReactNode {
66
return <docs-cards class={props.className}>{props.children}</docs-cards>;
77
}
88

0 commit comments

Comments
 (0)