Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Fix more ESLint errors #2738

Merged
merged 1 commit into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/components/AppLayout/Header/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Grow from '@material-ui/core/Grow'
import List from '@material-ui/core/List'
import Popper from '@material-ui/core/Popper'
import { withStyles } from '@material-ui/core/styles'
import * as React from 'react'
import { Link } from 'react-router-dom'

import Provider from './Provider'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { withStyles } from '@material-ui/core/styles'
import * as React from 'react'
import { ReactElement } from 'react'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can actually access it via React.ReactElement without importing, React namespace is available globally for types


import ConnectButton from 'src/components/ConnectButton'

Expand Down Expand Up @@ -34,7 +34,7 @@ const styles = () => ({
const StyledCard = styled(Card)`
padding: 20px;
`
const ConnectDetails = ({ classes }) => (
const ConnectDetails = ({ classes }): ReactElement => (
<StyledCard>
<Row align="center" margin="lg">
<Paragraph className={classes.text} noMargin size="xl" weight="bolder">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { withStyles } from '@material-ui/core/styles'
import * as React from 'react'
import { ReactElement } from 'react'

import Col from 'src/components/layout/Col'
import Paragraph from 'src/components/layout/Paragraph'
Expand All @@ -24,7 +24,7 @@ const styles = () => ({
},
})

const ProviderDisconnected = ({ classes }) => (
const ProviderDisconnected = ({ classes }): ReactElement => (
<>
<KeyRing circleSize={35} dotRight={11} dotSize={16} dotTop={24} keySize={17} mode="error" />
<Col className={classes.account} end="sm" layout="column" middle="xs">
Expand Down
7 changes: 4 additions & 3 deletions src/components/Spacer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as React from 'react'
import { ReactElement } from 'react'

const style = {
flexGrow: 1,
}

// eslint-disable-next-line react/display-name
export default ({ className }: any) => <div className={className} style={style} />
const Spacer = ({ className }: { className?: string }): ReactElement => <div className={className} style={style} />

export default Spacer
4 changes: 2 additions & 2 deletions src/components/forms/GnoForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react'
import { ReactElement } from 'react'
import { Form } from 'react-final-form'

const stylesBasedOn = (padding) => ({
Expand All @@ -17,7 +17,7 @@ const GnoForm = ({
subscription,
testId = '',
validation,
}: any) => (
}: any): ReactElement => (
<Form
decorators={decorators}
initialValues={initialValues}
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Button from '@material-ui/core/Button'
import * as React from 'react'
import { ReactElement } from 'react'

const calculateStyleBased = (minWidth, minHeight) => ({
minWidth: minWidth && `${minWidth}px`,
minHeight: minHeight && `${minHeight}px`,
})

const GnoButton = ({ minWidth, minHeight = 35, testId = '', style = {}, ...props }: any) => {
const GnoButton = ({ minWidth, minHeight = 35, testId = '', style = {}, ...props }: any): ReactElement => {
const calculatedStyle = calculateStyleBased(minWidth, minHeight)

return <Button data-testid={testId} style={{ ...calculatedStyle, ...style }} {...props} />
Expand Down
5 changes: 2 additions & 3 deletions src/components/layout/ButtonLink/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable react/button-has-type */
import cn from 'classnames/bind'
import * as React from 'react'
import { ReactElement } from 'react'

import styles from './index.module.scss'

Expand All @@ -14,7 +13,7 @@ const GnoButtonLink = ({
type = 'button',
weight = 'regular',
...props
}: any) => (
}: any): ReactElement => (
<button className={cx(styles.btnLink, size, color, weight, className)} data-testid={testId} type={type} {...props} />
)

Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/Col/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import classNames from 'classnames/bind'
import * as React from 'react'
import { ReactElement } from 'react'

import styles from './index.module.scss'

Expand Down Expand Up @@ -30,7 +30,7 @@ const Col = ({
xs,
xsOffset,
...props
}: any) => {
}: any): ReactElement => {
const colClassNames = cx(
'col',
center ? capitalize(center, 'center') : undefined,
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/Divider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react'
import { ReactElement } from 'react'

import { border } from 'src/theme/variables'

Expand All @@ -7,6 +7,6 @@ const style = {
height: '100%',
}

const Divider = ({ className }: any) => <div className={className} style={style} />
const Divider = ({ className }: { className?: string }): ReactElement => <div className={className} style={style} />

export default Divider
4 changes: 2 additions & 2 deletions src/components/layout/Hairline/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react'
import { ReactElement } from 'react'

import { getSize } from 'src/theme/size'
import { border } from 'src/theme/variables'
Expand All @@ -11,7 +11,7 @@ const calculateStyleFrom = (color, margin) => ({
margin: `${getSize(margin)} 0px`,
})

const Hairline = ({ className, color, margin, style }: any) => {
const Hairline = ({ className, color, margin, style }: any): ReactElement => {
const calculatedStyles = calculateStyleFrom(color, margin)
const mergedStyles = { ...calculatedStyles, ...(style || {}) }

Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/Pre/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import classNames from 'classnames/bind'
import * as React from 'react'
import { ReactElement } from 'react'

import styles from './index.module.scss'

const cx = classNames.bind(styles)

const Pre = ({ children, ...props }) => (
const Pre = ({ children, ...props }): ReactElement => (
<pre className={cx(styles.pre)} {...props}>
{children}
</pre>
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/Row/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import classNames from 'classnames/bind'
import * as React from 'react'
import { ReactElement } from 'react'

import styles from './index.module.scss'

import { capitalize } from 'src/utils/css'

const cx = classNames.bind(styles)

const Row = ({ align, children, className, grow, margin, testId = '', ...props }: any) => {
const Row = ({ align, children, className, grow, margin, testId = '', ...props }: any): ReactElement => {
const rowClassNames = cx(
styles.row,
margin ? capitalize(margin, 'margin') : undefined,
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TableBody from '@material-ui/core/TableBody'
import TableCell from '@material-ui/core/TableCell'
import TableHead from '@material-ui/core/TableHead'
import TableRow from '@material-ui/core/TableRow'
import * as React from 'react'
import { ReactElement } from 'react'

export { TableBody, TableCell, TableHead, TableRow }

Expand All @@ -16,7 +16,7 @@ const overflowStyle: any = {
}

// see: https://css-tricks.com/responsive-data-tables/
const GnoTable = ({ children, size }) => {
const GnoTable = ({ children, size }): ReactElement => {
const style = size ? buildWidthFrom(size) : undefined

return (
Expand Down
1 change: 0 additions & 1 deletion src/logic/notifications/notificationBuilder.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { IconButton } from '@material-ui/core'
import { Close as IconClose } from '@material-ui/icons'
import * as React from 'react'

import { Notification, NOTIFICATIONS } from './notificationTypes'

Expand Down
4 changes: 2 additions & 2 deletions src/routes/safe/components/Balances/AssetTableCell/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as React from 'react'
import { ReactElement } from 'react'

import Block from 'src/components/layout/Block'
import Img from 'src/components/layout/Img'
import Paragraph from 'src/components/layout/Paragraph'
import { setImageToPlaceholder } from 'src/routes/safe/components/Balances/utils'

const AssetTableCell = (props) => {
const AssetTableCell = (props): ReactElement => {
const { asset } = props

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { makeStyles } from '@material-ui/core/styles'
// import CallMade from '@material-ui/icons/CallMade'
import cn from 'classnames'
import * as React from 'react'
import { ReactElement } from 'react'
import { useSelector } from 'react-redux'

import Button from 'src/components/layout/Button'
Expand Down Expand Up @@ -98,7 +98,7 @@ const useStyles = makeStyles({
},
} as any)

const Item = ({ data, onSend }) => {
const Item = ({ data, onSend }): ReactElement => {
const granted = useSelector(grantedSelector)
const classes = useStyles({ backgroundColor: data.color, granted })

Expand Down