Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesmac committed Dec 18, 2024
1 parent 652dfb2 commit 34d5142
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export const ModuleCardHeader: React.FC<ModuleRenderProps & CardHeaderProps> = (
<>
{mod
? moduleTypes.map((moduleType) => {
const Icon = getModuleIcons(moduleType, mod)
return Icon ? <Icon key={moduleType} fontSize="large" color="primary" /> : null
})
const Icon = getModuleIcons(moduleType, mod)
return Icon ? <Icon key={moduleType} fontSize="large" color="primary" /> : null
})
: null}
</>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export const CryptoAssetRenderer: React.FC<CryptoAssetRendererProps> = ({ payloa
<Grid container spacing={1} justifyContent="center">
{cryptoAssetPayload
? Object.entries(cryptoAssetPayload.assets).map(([asset, priceInfo]) => (
<Grid item key={asset} xs={12} md={6} lg={4} xl={3}>
<CryptoAsset style={{ height: '100%' }} asset={asset} priceInfo={priceInfo} />
</Grid>
))
<Grid item key={asset} xs={12} md={6} lg={4} xl={3}>
<CryptoAsset style={{ height: '100%' }} asset={asset} priceInfo={priceInfo} />
</Grid>
))
: null}
</Grid>
</FlexCol>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const mapAssetsToString = (assetValues: Partial<Record<string, number>> | undefi
return assetValues
// eslint-disable-next-line unicorn/no-array-reduce
? Object.entries(assetValues).reduce<Partial<Record<string, string>>>((accumulator, [symbol, value]) => {
accumulator[symbol] = value?.toString()
return accumulator
}, {})
accumulator[symbol] = value?.toString()
return accumulator
}, {})
: undefined
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,26 @@ const AddressHistory = forwardRef<HTMLUListElement, AddressChainProps>(({
<AddressChainList ref={ulRef} {...props}>
{orderedAddressHistoryPairs
? orderedAddressHistoryPairs.map(([bw, bwHash], index) => (
<Fragment key={index + (bw.timestamp?.toString() ?? address ?? '')}>
{index === 0
? null
: (
<Divider
flexItem
orientation="vertical"
sx={{
height: theme.spacing(4), my: 1, width: '50%',
}}
/>
)}
<BoundWitnessRendererCard
payload={bw}
onClick={() => handleClick(bwHash)}
sx={{ cursor: selectable ? 'pointer' : 'default' }}
active={activeBoundWitnessHash ? bwHash === activeBoundWitnessHash : false}
/>
</Fragment>
))
<Fragment key={index + (bw.timestamp?.toString() ?? address ?? '')}>
{index === 0
? null
: (
<Divider
flexItem
orientation="vertical"
sx={{
height: theme.spacing(4), my: 1, width: '50%',
}}
/>
)}
<BoundWitnessRendererCard
payload={bw}
onClick={() => handleClick(bwHash)}
sx={{ cursor: selectable ? 'pointer' : 'default' }}
active={activeBoundWitnessHash ? bwHash === activeBoundWitnessHash : false}
/>
</Fragment>
))
: (
<>
{skeleton
Expand Down
1 change: 0 additions & 1 deletion packages/sdk/packages/event/src/hooks/useCustomEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const useCustomEvent = <TElement extends HTMLElement, TDetail = unknown>(
: undefined

if (handler && element) {
// eslint-disable-next-line @eslint-react/web-api/no-leaked-event-listener
element?.addEventListener(type, handler)
}
return () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export const TableRowNoData: React.FC<TableRowNoDataProps> = ({
</StyledTableCell>
{additionalCells
? Array.from({ length: additionalCells })
.fill(null)
.map((_fill, index) => <StyledTableCell key={index} hideBorder={hideBorder} />)
.fill(null)
.map((_fill, index) => <StyledTableCell key={index} hideBorder={hideBorder} />)
: null}
</TableRow>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const NameViewer: React.FC<NameViewerProps> = ({
<Chip size="small" label={reflection.kind} />
{reflection.flags
? Object.entries(reflection.flags).map(([flag, value]) => {
return value ? <Chip size="small" key={flag} label={trimFlagLabel(flag)} variant="outlined" /> : null
})
return value ? <Chip size="small" key={flag} label={trimFlagLabel(flag)} variant="outlined" /> : null
})
: null}
</Stack>
{document && document?.location.hostname === 'localhost' && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export const ReflectionGroupViewer: React.FC<ReflectionGroupViewerProps> = ({
const visibleChildren
= hiddenFlags
? resolvedChildren.reduce((acc, item) => {
return acc + (hide(item.flags, hiddenFlags) ? 0 : 1)
}, 0)
return acc + (hide(item.flags, hiddenFlags) ? 0 : 1)
}, 0)
: 1

const { hash } = useLocation()
Expand Down

0 comments on commit 34d5142

Please sign in to comment.