Skip to content

Commit 056c4a3

Browse files
committed
Fix TypeScript errors
1 parent 0d6ffb1 commit 056c4a3

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

src/components/ExampleLink.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import type { FC } from 'react';
44
import { useDocsPreferredVersion } from '@docusaurus/theme-common';
55
import VERSIONS from '../../versions.json';
66
import { translate } from '@docusaurus/Translate';
7-
import { Version } from '../shares/version';
7+
import type { Version } from '../shares/version';
8+
import Heading from '@theme/Heading';
89

910
interface ComponentProps {
10-
component: React.ComponentType<string>;
11+
component: string;
1112
}
1213
export const ExampleLink: FC<ComponentProps> = ({ component }) => {
1314
const docVersion = useDocsPreferredVersion();
@@ -25,12 +26,12 @@ export const ExampleLink: FC<ComponentProps> = ({ component }) => {
2526

2627
return (
2728
<div>
28-
<h2>
29+
<Heading as="h2">
2930
{translate({
3031
id: 'custom.view-example',
3132
message: 'Beispiel ansehen',
3233
})}
33-
</h2>
34+
</Heading>
3435
<KolLink
3536
_href={`https://public-ui.github.io/${version}/sample-react/#/${component}`}
3637
_label={translate({

src/components/LiveEditorCompact.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function fillDefaultValues(): TagNameToAttributes {
5555

5656
// apply certain provided demo values
5757
if (typeof demoValues[tagName]?.[attribute.name] !== 'undefined') {
58-
result[tagName][attribute.name] = demoValues[tagName]![attribute.name];
58+
result[tagName][attribute.name] = demoValues[tagName][attribute.name];
5959
}
6060
});
6161

src/components/Mermaid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type MermaidProps = {
99

1010
let mermaidTimeout: NodeJS.Timeout;
1111

12-
export const mermaidLoadContent = (config: any) => {
12+
export const mermaidLoadContent = (config: unknown) => {
1313
if (config) {
1414
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
1515
mermaid.initialize(Object.assign({ startOnLoad: true }, config));

src/shares/fetch-excel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ function getDataFromSheets(queryList: unknown[], resultList: Record<string, unkn
3333
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3434
const query = queryList.shift();
3535
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
36-
const { sheet, promise } = query as any;
36+
const { sheet, promise } = query as { sheet: string; promise: Promise<unknown> };
3737
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
38-
promise.then((result: unknown) => {
38+
void promise.then((result: unknown) => {
3939
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
4040
resultList[sheet] = result;
4141
resolve(getDataFromSheets(queryList, resultList));

src/shares/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const setTheme = (theme: Theme) => {
6666
STORE.theme = theme;
6767
setStore();
6868
} else {
69-
throw new Error(`The theme identifier "${theme}" is not valid or an available option.`);
69+
throw new Error(`The theme identifier "${theme as string}" is not valid or an available option.`);
7070
}
7171
};
7272

0 commit comments

Comments
 (0)