Updated dependencies and fixed coding styles

This commit is contained in:
Alejandro Celaya
2021-02-28 12:56:56 +01:00
parent fb2194d2d1
commit 47fb26368b
20 changed files with 3687 additions and 2136 deletions

View File

@@ -39,7 +39,7 @@ const DateInput = (props: DateInputProps) => {
{...transformProps(props)}
dateFormat="yyyy-MM-dd"
className={classNames('date-input-container__input form-control', className)}
// @ts-expect-error
// @ts-expect-error The DatePicker type definition is wrong. It has a ref prop
ref={ref}
/>
{showCalendarIcon && (

View File

@@ -2,7 +2,7 @@ import { FC } from 'react';
import { v4 as uuid } from 'uuid';
import { InputType } from 'reactstrap/lib/Input';
interface FormGroupContainer {
interface FormGroupContainerProps {
value: string;
onChange: (newValue: string) => void;
id?: string;
@@ -10,7 +10,7 @@ interface FormGroupContainer {
required?: boolean;
}
export const FormGroupContainer: FC<FormGroupContainer> = (
export const FormGroupContainer: FC<FormGroupContainerProps> = (
{ children, value, onChange, id = uuid(), type = 'text', required = true },
) => (
<div className="form-group">

View File

@@ -7,7 +7,7 @@ import './SearchField.scss';
const DEFAULT_SEARCH_INTERVAL = 500;
let timer: NodeJS.Timeout | null;
interface SearchField {
interface SearchFieldProps {
onChange: (value: string) => void;
className?: string;
placeholder?: string;
@@ -16,7 +16,7 @@ interface SearchField {
}
const SearchField = (
{ onChange, className, placeholder = 'Search...', large = true, noBorder = false }: SearchField,
{ onChange, className, placeholder = 'Search...', large = true, noBorder = false }: SearchFieldProps,
) => {
const [ searchTerm, setSearchTerm ] = useState('');

View File

@@ -61,7 +61,7 @@ export const intervalToDateRange = (dateInterval?: DateInterval): DateRange => {
case 'today':
return { startDate: moment().startOf('day'), endDate: moment() };
case 'yesterday':
const yesterday = moment().subtract(1, 'day');
const yesterday = moment().subtract(1, 'day'); // eslint-disable-line no-case-declarations
return { startDate: yesterday.startOf('day'), endDate: yesterday.endOf('day') };
case 'last7Days':

View File

@@ -34,7 +34,7 @@ export const useToggle = (initialValue = false): ToggleResult => {
export const useSwipeable = (showSidebar: () => void, hideSidebar: () => void) => {
const swipeMenuIfNoModalExists = (callback: () => void) => (e: any) => {
const swippedOnVisitsTable = (e.event.composedPath() as HTMLElement[]).some(
const swippedOnVisitsTable = (e.event.composedPath() as HTMLElement[]).some( // eslint-disable-lin @typescript-eslint/no-unsafe-call
({ classList }) => classList?.contains('visits-table'),
);