Skip to content

Commit

Permalink
auto-fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Prithpal-Sooriya committed Feb 14, 2025
1 parent 8c81e3a commit a10c885
Show file tree
Hide file tree
Showing 72 changed files with 203 additions and 222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ export const DefaultStory: StoryFn<typeof AlertModal> = (args) => {
{isOpen && (
<AlertModal
{...args}
alertKey={'From'}
alertKey="From"
onClose={handleOnClose}
onAcknowledgeClick={handleOnClose}
/>
)}
<Button onClick={handleOnClick} danger={true}>Open alert modal</Button>
<Button onClick={handleOnClick} danger>Open alert modal</Button>
</Box>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const TemplateStory: StoryFn<typeof ConfirmAlertModal> = (args) => {
onSubmit={handleOnClose}
/>
)}
<Button onClick={handleOnClick} danger={true}>
<Button onClick={handleOnClick} danger>
Open confirm alert modal
</Button>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('GeneralAlert', () => {
});

it('renders the details when provided', () => {
const details = <Text>{'Additional details'}</Text>;
const details = <Text>Additional details</Text>;
const onClickSupportLink = jest.fn();
const reportUrl = 'https://example.com/report';
const { getByText } = renderWithProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ export const TemplateStory: StoryFn<typeof MultipleAlertModal> = (args) => {
{isOpen && (
<MultipleAlertModal
{...args}
alertKey={'From'}
alertKey="From"
onClose={handleOnClose}
onFinalAcknowledgeClick={handleOnClose}
/>
)}
<Button onClick={handleOnClick} danger={true}>
<Button onClick={handleOnClick} danger>
Open multiple alert modal
</Button>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe('MultipleAlertModal', () => {
<MultipleAlertModal
{...defaultProps}
alertKey={DATA_ALERT_KEY_MOCK}
skipAlertNavigation={true}
skipAlertNavigation
/>,
mockStoreAcknowledgeAlerts,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('ConfigureSnapPopup', () => {
const { getByText } = renderWithProvider(
<ConfigureSnapPopup
onClose={mockOnClose}
link={'mockLink'}
link="mockLink"
isOpen
type={ConfigureSnapPopupType.CONFIGURE}
/>,
Expand All @@ -37,7 +37,7 @@ describe('ConfigureSnapPopup', () => {
const { getByText } = renderWithProvider(
<ConfigureSnapPopup
onClose={mockOnClose}
link={'mockLink'}
link="mockLink"
isOpen
type={ConfigureSnapPopupType.INSTALL}
/>,
Expand All @@ -55,7 +55,7 @@ describe('ConfigureSnapPopup', () => {
const { getByText } = renderWithProvider(
<ConfigureSnapPopup
onClose={mockOnClose}
link={'mockLink'}
link="mockLink"
isOpen
type={ConfigureSnapPopupType.CONFIGURE}
/>,
Expand Down
2 changes: 1 addition & 1 deletion ui/components/app/confirm/info/row/alert-row/alert-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const ConfirmInfoAlertRow = ({
onFinalAcknowledgeClick={handleModalClose}
onClose={handleModalClose}
showCloseIcon={false}
skipAlertNavigation={true}
skipAlertNavigation
/>
)}
<ConfirmInfoRow {...confirmInfoRowProps} labelChildren={inlineAlert} />
Expand Down
2 changes: 1 addition & 1 deletion ui/components/app/confirm/info/row/url.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ConfirmInfoRowUrl } from './url';
describe('ConfirmInfoRowUrl', () => {
it('should match snapshot', () => {
const { container } = render(
<ConfirmInfoRowUrl url={'https://example.com'} />,
<ConfirmInfoRowUrl url="https://example.com" />,
);
expect(container).toMatchSnapshot();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const KeyringSnapRemovalResult = ({
gap: 4,
}}
>
<ModalHeader onClose={onClose}>{''}</ModalHeader>
<ModalHeader onClose={onClose}></ModalHeader>
<Box
display={Display.Flex}
flexDirection={FlexDirection.Column}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function MultiRpcEditModal() {

return (
<Modal
isOpen={true}
isOpen
onClose={() => dispatch(setShowMultiRpcModal(false))}
isClosedOnOutsideClick={false}
isClosedOnEscapeKey={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export function MultichainTransactionDetailsModal({
onClose={onClose}
data-testid="multichain-transaction-details-modal"
isOpen
isClosedOnOutsideClick={true}
isClosedOnEscapeKey={true}
isClosedOnOutsideClick
isClosedOnEscapeKey
>
<ModalOverlay />
<ModalContent
Expand Down
2 changes: 1 addition & 1 deletion ui/components/app/name/name-details/name-details.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ describe('NameDetails', () => {
const { baseElement } = renderWithProvider(
<NameDetails
type={NameType.ETHEREUM_ADDRESS}
value={''}
value=""
variation={VARIATION_MOCK}
onClose={() => undefined}
/>,
Expand Down
2 changes: 1 addition & 1 deletion ui/components/app/name/name.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Name', () => {
const { container } = renderWithProvider(
<Name
type={NameType.ETHEREUM_ADDRESS}
value={''}
value=""
variation={VARIATION_MOCK}
/>,
store,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const SnapUIFileInput: FunctionComponent<SnapUIFileInputProps> = ({
name={name}
onChange={handleChange}
accept={accept?.join(',')}
hidden={true}
hidden
disabled={disabled}
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default {
(story) => (
<Provider store={store}>
<SnapInterfaceContextProvider
snapId={'npm:fooSnap'}
interfaceId={'foo'}
snapId="npm:fooSnap"
interfaceId="foo"
initialState={{ 'selector': 'foo' }}
context={{}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const SnapUITooltip: FunctionComponent<SnapUITooltipProps> = ({
return (
<Tooltip
html={content}
position={'bottom'}
position="bottom"
// Avoid tooltip from taking up the full width of the container
style={{ display: 'inline-flex' }}
>
Expand Down
2 changes: 1 addition & 1 deletion ui/components/app/srp-quiz-modal/SRPQuiz/SRPQuiz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function SRPQuiz(props: any) {
title = t('srpSecurityQuizTitle');
return (
<QuizContent
image={'images/reveal-srp.png'}
image="images/reveal-srp.png"
content={t('srpSecurityQuizIntroduction')}
buttons={[
{
Expand Down
66 changes: 32 additions & 34 deletions ui/components/app/wallet-overview/coin-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -498,41 +498,39 @@ const CoinButtons = ({
generateTooltip('sendButton', contents)
}
/>
{
<>
{showReceiveModal && (
<ReceiveModal
address={selectedAddress}
onClose={() => setShowReceiveModal(false)}
/>
)}
<IconButton
className={`${classPrefix}-overview__button`}
iconButtonClassName={iconButtonClassName}
data-testid={`${classPrefix}-overview-receive`}
Icon={
<Icon
name={IconName.ScanBarcode}
color={IconColor.primaryInverse}
size={IconSize.Sm}
/>
}
label={t('receive')}
onClick={() => {
trackEvent({
event: MetaMetricsEventName.NavReceiveButtonClicked,
category: MetaMetricsEventCategory.Navigation,
properties: {
text: 'Receive',
location: trackingLocation,
chain_id: chainId,
},
});
setShowReceiveModal(true);
}}
<>
{showReceiveModal && (
<ReceiveModal
address={selectedAddress}
onClose={() => setShowReceiveModal(false)}
/>
</>
}
)}
<IconButton
className={`${classPrefix}-overview__button`}
iconButtonClassName={iconButtonClassName}
data-testid={`${classPrefix}-overview-receive`}
Icon={
<Icon
name={IconName.ScanBarcode}
color={IconColor.primaryInverse}
size={IconSize.Sm}
/>
}
label={t('receive')}
onClick={() => {
trackEvent({
event: MetaMetricsEventName.NavReceiveButtonClicked,
category: MetaMetricsEventCategory.Navigation,
properties: {
text: 'Receive',
location: trackingLocation,
chain_id: chainId,
},
});
setShowReceiveModal(true);
}}
/>
</>
</Box>
);
};
Expand Down
2 changes: 1 addition & 1 deletion ui/components/app/wallet-overview/non-evm-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const NonEvmOverview = ({ className }: NonEvmOverviewProps) => {
balanceIsCached={false}
className={className}
chainId={chainId}
isSigningEnabled={true}
isSigningEnabled
isSwapsChain={isSwapsChain}
defaultSwapsToken={defaultSwapsToken}
///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask)
Expand Down
2 changes: 1 addition & 1 deletion ui/components/component-library/banner-tip/banner-tip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const BannerTip: BannerTipComponent = React.forwardRef(
>
<Box
as="img"
src={`images/fox.png`}
src="images/fox.png"
alt="Fox"
{...(logoProps as BoxProps<C>)}
className={classnames(
Expand Down
10 changes: 5 additions & 5 deletions ui/components/component-library/checkbox/checkbox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Checkbox', () => {
it('should render isChecked', () => {
const { getByRole, getByTestId } = render(
<Checkbox
isChecked={true}
isChecked
iconProps={{ 'data-testid': 'check-bold', name: IconName.CheckBold }}
/>,
);
Expand All @@ -56,7 +56,7 @@ describe('Checkbox', () => {
it('should render isIndeterminate', () => {
const { getByRole, getByTestId } = render(
<Checkbox
isIndeterminate={true}
isIndeterminate
iconProps={{ 'data-testid': 'minus-bold', name: IconName.MinusBold }}
/>,
);
Expand Down Expand Up @@ -89,7 +89,7 @@ describe('Checkbox', () => {
label="Option 1"
id="option-1"
data-testid="option-disabled"
isDisabled={true}
isDisabled
/>,
);

Expand All @@ -101,7 +101,7 @@ describe('Checkbox', () => {

test('Checkbox component is readOnly when isReadOnly is true', () => {
const { getByLabelText } = render(
<Checkbox label="Option 1" id="option-1" isReadOnly={true} />,
<Checkbox label="Option 1" id="option-1" isReadOnly />,
);

const checkbox = getByLabelText('Option 1');
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('Checkbox', () => {

test('Checkbox component is required when isRequired is true', () => {
const { getByLabelText } = render(
<Checkbox label="Option 1" id="option-1" isRequired={true} />,
<Checkbox label="Option 1" id="option-1" isRequired />,
);

const checkbox = getByLabelText('Option 1');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export const UseCaseDemos = (args) => (
variant={TextVariant.headingSm}
textAlign={TextAlign.Center}
backgroundColor={BackgroundColor.primaryAlternative}
ellipsis={true}
ellipsis
>
Title is sentence case no period
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('LottieAnimation', () => {
});

it('calls lottie.loadAnimation with correct config when using path', () => {
render(<LottieAnimation path={mockPath} loop={true} autoplay={true} />);
render(<LottieAnimation path={mockPath} loop autoplay />);

expect(lottie.loadAnimation).toHaveBeenCalledWith(
expect.objectContaining({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const Size: StoryFn<typeof ModalContent> = (args) => {
))}
</Box>
{currentSize && (
<Modal isOpen={true} onClose={() => setCurrentSize(null)}>
<Modal isOpen onClose={() => setCurrentSize(null)}>
<ModalContent
{...args}
size={getSize(currentSize)}
Expand Down
Loading

0 comments on commit a10c885

Please sign in to comment.