Removed no longer needed eslint disable comments

This commit is contained in:
Alejandro Celaya 2022-03-26 13:07:58 +01:00
parent 28a5166f56
commit 98450ebec3
12 changed files with 10 additions and 13 deletions

View file

@ -1,5 +1,3 @@
/* eslint-disable no-console, @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/promise-function-async, @typescript-eslint/prefer-optional-chain */
// Do this as the first thing so that any code reading it knows the right env. // Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'production'; process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production'; process.env.NODE_ENV = 'production';

View file

@ -76,7 +76,6 @@ export default class ShlinkApiClient {
this.performRequest(`/short-urls/${shortCode}`, 'DELETE', { domain }) this.performRequest(`/short-urls/${shortCode}`, 'DELETE', { domain })
.then(() => {}); .then(() => {});
// eslint-disable-next-line valid-jsdoc
/** /**
* @deprecated. If using Shlink 2.6.0 or greater, use updateShortUrl instead * @deprecated. If using Shlink 2.6.0 or greater, use updateShortUrl instead
*/ */

View file

@ -33,6 +33,6 @@ render(
// Learn more about service workers: https://cra.link/PWA // Learn more about service workers: https://cra.link/PWA
registerServiceWorker({ registerServiceWorker({
onUpdate() { onUpdate() {
store.dispatch(appUpdateAvailable()); // eslint-disable-line @typescript-eslint/no-unsafe-call store.dispatch(appUpdateAvailable());
}, },
}); });

View file

@ -22,7 +22,7 @@ interface QrCodeModalConnectProps extends ShortUrlModalProps {
selectedServer: SelectedServer; selectedServer: SelectedServer;
} }
const QrCodeModal = (imageDownloader: ImageDownloader, ForServerVersion: FC<Versions>) => ( // eslint-disable-line const QrCodeModal = (imageDownloader: ImageDownloader, ForServerVersion: FC<Versions>) => (
{ shortUrl: { shortUrl, shortCode }, toggle, isOpen, selectedServer }: QrCodeModalConnectProps, { shortUrl: { shortUrl, shortCode }, toggle, isOpen, selectedServer }: QrCodeModalConnectProps,
) => { ) => {
const [size, setSize] = useState(300); const [size, setSize] = useState(300);

View file

@ -36,7 +36,7 @@ export const useToggle = (initialValue = false): ToggleResult => {
export const useSwipeable = (showSidebar: () => void, hideSidebar: () => void) => { export const useSwipeable = (showSidebar: () => void, hideSidebar: () => void) => {
const swipeMenuIfNoModalExists = (callback: () => void) => (e: any) => { const swipeMenuIfNoModalExists = (callback: () => void) => (e: any) => {
const swippedOnVisitsTable = (e.event.composedPath() as HTMLElement[]).some( // eslint-disable-line @typescript-eslint/no-unsafe-call const swippedOnVisitsTable = (e.event.composedPath() as HTMLElement[]).some(
({ classList }) => classList?.contains('visits-table'), ({ classList }) => classList?.contains('visits-table'),
); );

View file

@ -31,7 +31,7 @@ export const highlightedVisitsToStats = <T extends NormalizedVisit>(
export const toApiParams = ({ page, itemsPerPage, filter, dateRange }: VisitsParams): ShlinkVisitsParams => { export const toApiParams = ({ page, itemsPerPage, filter, dateRange }: VisitsParams): ShlinkVisitsParams => {
const startDate = (dateRange?.startDate && formatIsoDate(dateRange?.startDate)) ?? undefined; const startDate = (dateRange?.startDate && formatIsoDate(dateRange?.startDate)) ?? undefined;
const endDate = (dateRange?.endDate && formatIsoDate(dateRange?.endDate)) ?? undefined; const endDate = (dateRange?.endDate && formatIsoDate(dateRange?.endDate)) ?? undefined;
const excludeBots = filter?.excludeBots || undefined; // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing const excludeBots = filter?.excludeBots || undefined;
return { page, itemsPerPage, startDate, endDate, excludeBots }; return { page, itemsPerPage, startDate, endDate, excludeBots };
}; };

View file

@ -73,7 +73,7 @@ describe('<App />', () => {
['/bar', 'shlink-wrapper'], ['/bar', 'shlink-wrapper'],
['/', 'shlink-wrapper d-flex d-md-block align-items-center'], ['/', 'shlink-wrapper d-flex d-md-block align-items-center'],
])('renders expected classes on shlink-wrapper based on current pathname', (pathname, expectedClasses) => { ])('renders expected classes on shlink-wrapper based on current pathname', (pathname, expectedClasses) => {
(useLocation as any).mockReturnValue({ pathname }); // eslint-disable-line @typescript-eslint/no-unsafe-call (useLocation as any).mockReturnValue({ pathname });
const wrapper = createWrapper(); const wrapper = createWrapper();
const shlinkWrapper = wrapper.find('.shlink-wrapper'); const shlinkWrapper = wrapper.find('.shlink-wrapper');

View file

@ -12,7 +12,7 @@ describe('ReportExporter', () => {
beforeEach(jest.clearAllMocks); beforeEach(jest.clearAllMocks);
beforeEach(() => { beforeEach(() => {
(global as any).Blob = class Blob {}; // eslint-disable-line @typescript-eslint/no-extraneous-class (global as any).Blob = class Blob {};
(global as any).URL = { createObjectURL: () => '' }; (global as any).URL = { createObjectURL: () => '' };
exporter = new ReportExporter(windowMock, csvToJsonMock); exporter = new ReportExporter(windowMock, csvToJsonMock);

View file

@ -78,7 +78,7 @@ describe('<ImportServersBtn />', () => {
const wrapper = createWrapper(); const wrapper = createWrapper();
const file = wrapper.find('.import-servers-btn__csv-select'); const file = wrapper.find('.import-servers-btn__csv-select');
await file.simulate('change', { target: { files: [''] } }); // eslint-disable-line @typescript-eslint/await-thenable await file.simulate('change', { target: { files: [''] } });
expect(importServersFromFile).toHaveBeenCalledTimes(1); expect(importServersFromFile).toHaveBeenCalledTimes(1);
}); });

View file

@ -35,7 +35,7 @@ describe('ServersExporter', () => {
beforeEach(() => { beforeEach(() => {
originalConsole = global.console; originalConsole = global.console;
global.console = Mock.of<Console>({ error }); global.console = Mock.of<Console>({ error });
(global as any).Blob = class Blob {}; // eslint-disable-line @typescript-eslint/no-extraneous-class (global as any).Blob = class Blob {};
(global as any).URL = { createObjectURL: () => '' }; (global as any).URL = { createObjectURL: () => '' };
}); });
afterEach(() => { afterEach(() => {

View file

@ -58,7 +58,7 @@ describe('<DeleteTagConfirmModal />', () => {
const footer = wrapper.find(ModalFooter); const footer = wrapper.find(ModalFooter);
const delBtn = footer.find(Button).last(); const delBtn = footer.find(Button).last();
await delBtn.simulate('click'); // eslint-disable-line @typescript-eslint/await-thenable await delBtn.simulate('click');
expect(deleteTag).toHaveBeenCalledTimes(1); expect(deleteTag).toHaveBeenCalledTimes(1);
expect(deleteTag).toHaveBeenCalledWith(tag); expect(deleteTag).toHaveBeenCalledWith(tag);

View file

@ -83,7 +83,7 @@ describe('<EditTagModal />', () => {
expect(editTag).not.toHaveBeenCalled(); expect(editTag).not.toHaveBeenCalled();
expect(tagEdited).not.toHaveBeenCalled(); expect(tagEdited).not.toHaveBeenCalled();
await form.simulate('submit', { preventDefault: jest.fn() }); // eslint-disable-line @typescript-eslint/await-thenable await form.simulate('submit', { preventDefault: jest.fn() });
expect(editTag).toHaveBeenCalled(); expect(editTag).toHaveBeenCalled();
expect(tagEdited).toHaveBeenCalled(); expect(tagEdited).toHaveBeenCalled();