fixed typescript strict of accordianComponent.tsx and schemaAnalyser (#804)

This commit is contained in:
Sunil Kumar Yadav 2021-05-20 06:41:25 +05:30 committed by GitHub
parent 735a81db47
commit d06e27a037
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -3,11 +3,10 @@
*/
import * as React from "react";
import * as Constants from "../../../Common/Constants";
import AnimateHeight from "react-animate-height";
import TriangleDownIcon from "../../../../images/Triangle-down.svg";
import TriangleRightIcon from "../../../../images/Triangle-right.svg";
import * as Constants from "../../../Common/Constants";
export interface AccordionComponentProps {}
@ -27,12 +26,12 @@ export interface AccordionItemComponentProps {
}
interface AccordionItemComponentState {
isExpanded: boolean;
isExpanded?: boolean;
}
export class AccordionItemComponent extends React.Component<AccordionItemComponentProps, AccordionItemComponentState> {
private static readonly durationMS = 500;
private isExpanded: boolean;
private isExpanded?: boolean;
constructor(props: AccordionItemComponentProps) {
super(props);
@ -79,7 +78,7 @@ export class AccordionItemComponent extends React.Component<AccordionItemCompone
);
}
private onHeaderClick = (event: React.MouseEvent<HTMLDivElement>): void => {
private onHeaderClick = (_event: React.MouseEvent<HTMLDivElement>): void => {
this.setState({ isExpanded: !this.state.isExpanded });
};

View File

@ -13,7 +13,7 @@ import * as React from "react";
type SchemaAnalyzerHeaderProps = {
isKernelIdle: boolean;
isKernelBusy: boolean;
onSampleSizeUpdated: (sampleSize: string) => void;
onSampleSizeUpdated: (sampleSize?: string) => void;
onAnalyzeButtonClick: (filter: string, sampleSize: string) => void;
};
@ -30,15 +30,15 @@ export const SchemaAnalyzerHeader = ({
onSampleSizeUpdated,
onAnalyzeButtonClick,
}: SchemaAnalyzerHeaderProps): JSX.Element => {
const [filter, setFilter] = React.useState<string>(DefaultFilter);
const [sampleSize, setSampleSize] = React.useState<string>(DefaultSampleSize);
const [filter, setFilter] = React.useState<string | undefined>(DefaultFilter);
const [sampleSize, setSampleSize] = React.useState<string | undefined>(DefaultSampleSize);
return (
<Stack horizontal tokens={{ childrenGap: 10 }}>
<Stack.Item grow>
<TextField
value={filter}
onChange={(event, newValue) => setFilter(newValue)}
onChange={(_event, newValue?: string) => setFilter(newValue)}
label="Filter"
placeholder={FilterPlaceholder}
disabled={!isKernelIdle}
@ -47,7 +47,7 @@ export const SchemaAnalyzerHeader = ({
<Stack.Item>
<TextField
value={sampleSize}
onChange={(event, newValue) => {
onChange={(_event, newValue?: string) => {
const num = Number(newValue);
if (!newValue || (num >= MinSampleSize && num <= MaxSampleSize)) {
setSampleSize(newValue);

View File

@ -8,6 +8,7 @@
"noUnusedParameters": true
},
"files": [
"./src/Explorer/Controls/Accordion/AccordionComponent.tsx",
"./src/AuthType.ts",
"./src/Bindings/ReactBindingHandler.ts",
"./src/Common/ArrayHashMap.ts",
@ -138,4 +139,4 @@
"src/Terminal/**/*",
"src/Utils/arm/**/*"
]
}
}