Add import type whenever possible

This commit is contained in:
Alejandro Celaya
2023-02-18 10:40:37 +01:00
parent 7add854b40
commit 2a5480da79
317 changed files with 955 additions and 807 deletions

View File

@@ -1,4 +1,4 @@
import { ActiveElement, ChartEvent, ChartType, TooltipItem } from 'chart.js';
import type { ActiveElement, ChartEvent, ChartType, TooltipItem } from 'chart.js';
import { prettify } from './numbers';
export const pointerOnHover = ({ native }: ChartEvent, [firstElement]: ActiveElement[]) => {

View File

@@ -1,5 +1,5 @@
import { format, formatISO, isBefore, isEqual, isWithinInterval, parse, parseISO as stdParseISO } from 'date-fns';
import { OptionalString } from '../utils';
import type { OptionalString } from '../utils';
export const STANDARD_DATE_FORMAT = 'yyyy-MM-dd';

View File

@@ -1,6 +1,7 @@
import { subDays, startOfDay, endOfDay } from 'date-fns';
import { cond, filter, isEmpty, T } from 'ramda';
import { dateOrNull, DateOrString, formatInternational, isBeforeOrEqual, now, parseISO } from './date';
import type { DateOrString } from './date';
import { dateOrNull, formatInternational, isBeforeOrEqual, now, parseISO } from './date';
import { equals } from '../utils';
export interface DateRange {

View File

@@ -1,5 +1,7 @@
import { isReachableServer, SelectedServer } from '../../servers/data';
import { SemVerPattern, versionMatch } from './version';
import type { SelectedServer } from '../../servers/data';
import { isReachableServer } from '../../servers/data';
import type { SemVerPattern } from './version';
import { versionMatch } from './version';
const serverMatchesMinVersion = (minVersion: SemVerPattern) => (selectedServer: SelectedServer): boolean =>
isReachableServer(selectedServer) && versionMatch(selectedServer.version, { minVersion });

View File

@@ -1,4 +1,5 @@
import { DependencyList, EffectCallback, useEffect, useRef, useState } from 'react';
import type { DependencyList, EffectCallback } from 'react';
import { useEffect, useRef, useState } from 'react';
import { useSwipeable as useReactSwipeable } from 'react-swipeable';
import { useLocation, useNavigate } from 'react-router-dom';
import { v4 as uuid } from 'uuid';

View File

@@ -1,6 +1,7 @@
import { createAsyncThunk as baseCreateAsyncThunk, AsyncThunkPayloadCreator } from '@reduxjs/toolkit';
import type { AsyncThunkPayloadCreator } from '@reduxjs/toolkit';
import { createAsyncThunk as baseCreateAsyncThunk } from '@reduxjs/toolkit';
import { identity } from 'ramda';
import { ShlinkState } from '../../container/types';
import type { ShlinkState } from '../../container/types';
export const createAsyncThunk = <Returned, ThunkArg>(
typePrefix: string,

View File

@@ -1,6 +1,7 @@
import { compare } from 'compare-versions';
import { identity, memoizeWith } from 'ramda';
import { Empty, hasValue } from '../utils';
import type { Empty } from '../utils';
import { hasValue } from '../utils';
type SemVerPatternFragment = `${bigint | '*'}`;

View File

@@ -1,7 +1,8 @@
import bowser from 'bowser';
import { zipObj } from 'ramda';
import { Empty, hasValue } from '../utils';
import { Stats, UserAgent } from '../../visits/types';
import type { Empty } from '../utils';
import { hasValue } from '../utils';
import type { Stats, UserAgent } from '../../visits/types';
const DEFAULT = 'Others';
const BROWSERS_WHITELIST = [