Remove @typescript-eslint/no-empty-function rule exception
[MAILPOET-3201]
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
"@typescript-eslint/await-thenable": "off",
|
||||
"@typescript-eslint/camelcase": "off",
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-use-before-define": "off",
|
||||
// PropTypes
|
||||
|
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import MailPoet from 'mailpoet';
|
||||
import ReactStringReplace from 'react-string-replace';
|
||||
import jQuery from 'jquery';
|
||||
import { noop } from 'lodash';
|
||||
|
||||
export const withFeatureAnnouncement = <P extends object>(
|
||||
Component: React.ComponentType<P>
|
||||
@@ -67,7 +68,7 @@ export const withFeatureAnnouncement = <P extends object>(
|
||||
return;
|
||||
}
|
||||
showDot = false;
|
||||
beamerCallback = () => {}; // We show Beamer panel only on first callback after initialization
|
||||
beamerCallback = noop; // We show Beamer panel only on first callback after initialization
|
||||
MailPoet.Modal.loading(false);
|
||||
(window as any).Beamer.show();
|
||||
updateLastAnnouncementSeenValue();
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { noop } from 'lodash';
|
||||
import React from 'react';
|
||||
import Categories from '../categories';
|
||||
|
||||
@@ -17,9 +18,9 @@ export const CategoriesWithCount = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Categories onSelect={() => {}} categories={categories} active={categories[0].name} />
|
||||
<Categories onSelect={() => {}} categories={categories} active={categories[2].name} />
|
||||
<Categories onSelect={() => {}} categories={categories} active={categories[4].name} />
|
||||
<Categories onSelect={noop} categories={categories} active={categories[0].name} />
|
||||
<Categories onSelect={noop} categories={categories} active={categories[2].name} />
|
||||
<Categories onSelect={noop} categories={categories} active={categories[4].name} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -35,9 +36,9 @@ export const CategoriesWithoutCount = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Categories onSelect={() => {}} categories={categories} active={categories[0].name} />
|
||||
<Categories onSelect={() => {}} categories={categories} active={categories[2].name} />
|
||||
<Categories onSelect={() => {}} categories={categories} active={categories[4].name} />
|
||||
<Categories onSelect={noop} categories={categories} active={categories[0].name} />
|
||||
<Categories onSelect={noop} categories={categories} active={categories[2].name} />
|
||||
<Categories onSelect={noop} categories={categories} active={categories[4].name} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { noop } from 'lodash';
|
||||
|
||||
import ModalFrame from './frame';
|
||||
import ModalHeader from './header';
|
||||
@@ -23,7 +24,7 @@ function Modal({
|
||||
isDismissible = true,
|
||||
shouldCloseOnEsc = true,
|
||||
shouldCloseOnClickOutside = true,
|
||||
onRequestClose = () => {},
|
||||
onRequestClose = noop,
|
||||
fullScreen = false,
|
||||
contentClassName = '',
|
||||
overlayClassName = '',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { noop } from 'lodash';
|
||||
|
||||
const ESCAPE = 27;
|
||||
|
||||
@@ -16,7 +17,7 @@ function ModalOverlay({
|
||||
isDismissible = true,
|
||||
shouldCloseOnEsc = true,
|
||||
shouldCloseOnClickOutside = true,
|
||||
onRequestClose = () => {},
|
||||
onRequestClose = noop,
|
||||
className = '',
|
||||
children,
|
||||
}: Props) {
|
||||
|
@@ -4,6 +4,7 @@ import jQuery from 'jquery';
|
||||
import MailPoet from 'mailpoet';
|
||||
import Modal from 'common/modal/modal';
|
||||
import { GlobalContext } from 'context';
|
||||
import { noop } from 'lodash';
|
||||
|
||||
const mailPoetApiVersion = (window as any).mailpoet_api_version as string;
|
||||
|
||||
@@ -146,7 +147,7 @@ const SetFromAddressModal = ({ onRequestClose, setAuthorizedAddress }: Props) =>
|
||||
};
|
||||
|
||||
SetFromAddressModal.defaultProps = {
|
||||
setAuthorizedAddress: () => {},
|
||||
setAuthorizedAddress: noop,
|
||||
};
|
||||
|
||||
export default SetFromAddressModal;
|
||||
|
@@ -8,6 +8,7 @@ import {
|
||||
useHistory,
|
||||
useRouteMatch,
|
||||
} from 'react-router-dom';
|
||||
import { noop } from 'lodash';
|
||||
|
||||
import Tabs, { Props as TabProps } from './tabs';
|
||||
|
||||
@@ -48,7 +49,7 @@ const RoutedTabs = ({
|
||||
routerType = 'hash',
|
||||
routerPrefix = '/',
|
||||
activeKey,
|
||||
onSwitch = () => {},
|
||||
onSwitch = noop,
|
||||
automationId = null,
|
||||
children,
|
||||
}: Props) => {
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import classnames from 'classnames';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { noop } from 'lodash';
|
||||
|
||||
import Tab from './tab';
|
||||
|
||||
@@ -47,7 +48,7 @@ type Props = {
|
||||
|
||||
const Tabs = ({
|
||||
activeKey,
|
||||
onSwitch = () => {},
|
||||
onSwitch = noop,
|
||||
automationId = null,
|
||||
children,
|
||||
}: Props) => {
|
||||
|
@@ -4,6 +4,7 @@ import ReactDOM from 'react-dom';
|
||||
import SetFromAddressModal from 'common/set_from_address_modal';
|
||||
import { GlobalContext, useGlobalContextValue } from 'context/index.jsx';
|
||||
import Notices from 'notices/notices.jsx';
|
||||
import { noop } from 'lodash';
|
||||
|
||||
type Props = {
|
||||
onRequestClose?: () => void;
|
||||
@@ -36,7 +37,7 @@ const App = ({ onRequestClose }: Props) => {
|
||||
};
|
||||
|
||||
App.defaultProps = {
|
||||
onRequestClose: () => {},
|
||||
onRequestClose: noop,
|
||||
};
|
||||
|
||||
// nothing is actually rendered to the container because the <Modal> component uses
|
||||
|
Reference in New Issue
Block a user