fix: @typescript-eslint/no-explicit-any

This commit is contained in:
Griffithtp
2019-06-24 23:54:32 +01:00
parent 31c11f2b5b
commit 2f28ade710
16 changed files with 74 additions and 44 deletions

View File

@@ -1,5 +1,6 @@
import React, { MouseEvent } from 'react';
import capitalize from 'lodash/capitalize';
import { Breakpoint } from '@material-ui/core/styles/createBreakpoints';
import { Svg, Img, ImgWrapper } from './styles';
@@ -57,10 +58,10 @@ export interface Props {
name: keyof IconsMap;
className?: string;
onClick?: (event: MouseEvent<SVGElement | HTMLSpanElement>) => void;
size?: 'sm' | 'md';
size?: Breakpoint;
pointer?: boolean;
img?: boolean;
modifiers?: any;
modifiers?: null | undefined;
}
const Icon: React.FC<Props> = ({ className, name, size = 'sm', img = false, pointer = false, ...props }) => {

View File

@@ -1,6 +1,7 @@
import styled, { css } from 'react-emotion';
import { Breakpoint } from '@material-ui/core/styles/createBreakpoints';
const getSize = (size: 'md' | 'sm' | string): string => {
const getSize = (size: Breakpoint): string => {
switch (size) {
case 'md':
return `
@@ -15,7 +16,7 @@ const getSize = (size: 'md' | 'sm' | string): string => {
}
};
const commonStyle = ({ size = 'sm' as 'md' | 'sm' | string, pointer, modifiers = null }): string => css`
const commonStyle = ({ size = 'sm' as Breakpoint, pointer, modifiers = null }): string => css`
&& {
display: inline-block;
cursor: ${pointer ? 'pointer' : 'default'};