Skip to content

Commit

Permalink
feat: add eslint jsx-quotes & jsx-curly-brace-presence rules
Browse files Browse the repository at this point in the history
  • Loading branch information
compojoom committed Mar 26, 2024
1 parent 20bf72b commit e32c567
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
}
],
"no-only-tests/no-only-tests": "error",
"object-shorthand": ["error", "properties"]
"object-shorthand": ["error", "properties"],
"jsx-quotes": ["error", "prefer-double"],
"react/jsx-curly-brace-presence": ["error", { "props": "never", "children": "never" }]
},
"ignorePatterns": ["node_modules/", ".next/", ".github/"],
"plugins": ["unused-imports", "@typescript-eslint", "no-only-tests"]
Expand Down
2 changes: 1 addition & 1 deletion src/components/batch/BatchIndicator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const BatchIndicator = ({ onClick }: { onClick?: () => void }) => {
<Badge
variant="standard"
badgeContent={length}
color={'secondary'}
color="secondary"
anchorOrigin={{
vertical: 'bottom',
horizontal: 'right',
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/EthHashInfo/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ describe('EthHashInfo', () => {
)

const { container } = render(
<EthHashInfo address={'0xe26920604f9a02c5a877d449faa71b7504f0c2508dcc7c0384078a024b8e592f'} showCopyButton />,
<EthHashInfo address="0xe26920604f9a02c5a877d449faa71b7504f0c2508dcc7c0384078a024b8e592f" showCopyButton />,
)

const button = container.querySelector('button')
Expand Down
2 changes: 1 addition & 1 deletion src/components/nfts/NftCollections/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const NftCollections = (): ReactElement => {
)}

{/* NFT preview */}
{<NftPreviewModal onClose={() => setPreviewNft(undefined)} nft={previewNft} />}
<NftPreviewModal onClose={() => setPreviewNft(undefined)} nft={previewNft} />
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/safe-apps/SafeAppCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const SafeAppCardGridView = ({
openPreviewDrawer,
}: SafeAppCardViewProps) => {
return (
<SafeAppCardContainer safeAppUrl={safeAppUrl} onClickSafeApp={onClickSafeApp} height={'100%'}>
<SafeAppCardContainer safeAppUrl={safeAppUrl} onClickSafeApp={onClickSafeApp} height="100%">
{/* Safe App Header */}
<CardHeader
className={css.safeAppHeader}
Expand Down
2 changes: 1 addition & 1 deletion src/components/safe-apps/SafeAppSocialLinksCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const SafeAppSocialLinksCard = ({ safeApp }: SafeAppSocialLinksCardProps) => {
)}

{hasSocialLinks && developerWebsite && (
<Divider sx={{ height: '40px' }} orientation="vertical" component={'div'} />
<Divider sx={{ height: '40px' }} orientation="vertical" component="div" />
)}

{/* Developer website section */}
Expand Down
2 changes: 1 addition & 1 deletion src/components/safe-apps/SafeAppsFilters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const SafeAppsFilters = ({
) : (
<MenuItem disabled sx={{ padding: '0 6px 2px 6px', height: CATEGORY_OPTION_HEIGHT }} disableGutters>
<ListItemText
primary={'No categories defined'}
primary="No categories defined"
primaryTypographyProps={{ fontSize: 14, paddingLeft: '5px' }}
/>
</MenuItem>
Expand Down
2 changes: 1 addition & 1 deletion src/components/safe-messages/MsgSigners/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const MsgSigners = ({
<ListItemText>
<Box display="flex" flexDirection="row" alignItems="center" gap={1}>
<Skeleton variant="circular" width={36} height={36} />
<Typography variant="body2" color={'text.secondary'}>
<Typography variant="body2" color="text.secondary">
Confirmation #{idx + 1 + confirmationsSubmitted}
</Typography>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/components/transactions/UntrustedTxWarning/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import WarningIcon from '@/public/images/notifications/warning.svg'

const UntrustedTxWarning = () => {
return (
<Tooltip title={`This token is unfamiliar and may pose risks when interacting with it or involved addresses`}>
<Tooltip title="This token is unfamiliar and may pose risks when interacting with it or involved addresses">
<Box
lineHeight="16px"
sx={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const ReviewSpendingLimit = ({ params }: { params: NewSpendingLimitFlowPr
>
{existingAmount}
</Typography>
{'→'}
</>
)}
</SendAmountBlock>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tx/SignOrExecuteForm/ExecuteForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const ExecuteForm = ({
Cannot execute a transaction from the Safe Account itself, please connect a different account.
</ErrorMessage>
) : !walletCanPay && !willRelay ? (
<ErrorMessage level={'info'}>
<ErrorMessage level="info">
Your connected wallet doesn&apos;t have enough funds to execute this transaction.
</ErrorMessage>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('SignOrExecute', () => {
safeTx={safeTxBuilder().build()}
onSubmit={jest.fn()}
safeTxError={undefined}
txId={'someid'}
txId="someid"
isExecutable={true}
chainId="1"
/>,
Expand Down

0 comments on commit e32c567

Please sign in to comment.