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