Skip to content

Commit 7181b4f

Browse files
author
Kubit
committed
Fix eslint and typescript errors
1 parent 6fe0a74 commit 7181b4f

File tree

5 files changed

+14
-31
lines changed

5 files changed

+14
-31
lines changed

src/components/backToTop/backToTopControlled.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,9 @@ const BackToTopControlledComponent = React.forwardRef(
2525

2626
const innerRef = React.useRef<HTMLButtonElement | null>(null);
2727

28-
React.useImperativeHandle(
29-
ref,
30-
() => {
31-
return innerRef?.current as HTMLButtonElement;
32-
},
33-
[]
34-
);
28+
React.useImperativeHandle(ref, () => {
29+
return innerRef?.current as HTMLButtonElement;
30+
}, []);
3531

3632
const { state, setRef } = useManageState({
3733
states: Object.values(BackToTopStateType) as States,

src/components/option/option.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ export const OptionComponent = React.forwardRef(
2020
const [hover, setHover] = React.useState(false);
2121
const [focused, setFocused] = React.useState(false);
2222

23-
React.useImperativeHandle(
24-
ref,
25-
() => {
26-
return innerRef.current as HTMLElement;
27-
},
28-
[]
29-
);
23+
React.useImperativeHandle(ref, () => {
24+
return innerRef.current as HTMLElement;
25+
}, []);
3026

3127
React.useEffect(() => {
3228
if (focus) {

src/components/pillSelector/pillSelectorControlled.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,9 @@ const PillSelectorControlledComponent = React.forwardRef(
3838
}
3939
};
4040

41-
React.useImperativeHandle(
42-
ref,
43-
() => {
44-
return measuredRef.current as HTMLDivElement;
45-
},
46-
[]
47-
);
41+
React.useImperativeHandle(ref, () => {
42+
return measuredRef.current as HTMLDivElement;
43+
}, []);
4844

4945
React.useEffect(() => {
5046
let resizeObserver: ResizeObserver;

src/components/pillSelector/pillSelectorStandAlone.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@ const PillSelectorStandAloneComponent = (
3030

3131
const isPillSelected = props.pillSelected?.length !== 0;
3232

33-
React.useImperativeHandle(
34-
ref,
35-
() => {
36-
return listEl.current as HTMLDivElement;
37-
},
38-
[]
39-
);
33+
React.useImperativeHandle(ref, () => {
34+
return listEl.current as HTMLDivElement;
35+
}, []);
4036

4137
return (
4238
<PillSelectorWrapper

src/hooks/useInput/__tests__/useInput.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import { act, renderHook } from '@testing-library/react-hooks';
22
import React, { ChangeEvent } from 'react';
33

4-
import { FormatNumber } from '@/components';
54
import * as validationsProvider from '@/provider/validations/validationsProvider';
65

76
import { useInput } from '../useInput';
87

98
describe('useInput Hook', () => {
109
it('useInput - on internal change should call parent onChange', () => {
1110
const onChange = jest.fn();
12-
const formatNumber = { style: 'decimal' } as FormatNumber;
11+
const formatNumber = { style: 'decimal' };
1312
const ref = React.createRef<HTMLInputElement | undefined>();
1413
const currentValue = '123234';
1514
const regex = new RegExp('^[0-9]*$');
@@ -44,7 +43,7 @@ describe('useInput Hook', () => {
4443
});
4544
it('useInput - on internal blur should call parent onBlur', () => {
4645
const onBlur = jest.fn();
47-
const formatNumber = { style: 'decimal' } as FormatNumber;
46+
const formatNumber = { style: 'decimal' };
4847
const { result } = renderHook(() => useInput({ onBlur, formatNumber }));
4948

5049
act(() => {

0 commit comments

Comments
 (0)