diff --git a/scripts/create-dist-file.js b/scripts/create-dist-file.js index 3d6c31c4..2c166a9b 100644 --- a/scripts/create-dist-file.js +++ b/scripts/create-dist-file.js @@ -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. process.env.BABEL_ENV = 'production'; process.env.NODE_ENV = 'production'; diff --git a/src/api/services/ShlinkApiClient.ts b/src/api/services/ShlinkApiClient.ts index cf9220e7..39e3ade1 100644 --- a/src/api/services/ShlinkApiClient.ts +++ b/src/api/services/ShlinkApiClient.ts @@ -76,7 +76,6 @@ export default class ShlinkApiClient { this.performRequest(`/short-urls/${shortCode}`, 'DELETE', { domain }) .then(() => {}); - // eslint-disable-next-line valid-jsdoc /** * @deprecated. If using Shlink 2.6.0 or greater, use updateShortUrl instead */ diff --git a/src/index.tsx b/src/index.tsx index 785523b1..12aa43a1 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -33,6 +33,6 @@ render( // Learn more about service workers: https://cra.link/PWA registerServiceWorker({ onUpdate() { - store.dispatch(appUpdateAvailable()); // eslint-disable-line @typescript-eslint/no-unsafe-call + store.dispatch(appUpdateAvailable()); }, }); diff --git a/src/short-urls/helpers/QrCodeModal.tsx b/src/short-urls/helpers/QrCodeModal.tsx index 88230978..d0a7b996 100644 --- a/src/short-urls/helpers/QrCodeModal.tsx +++ b/src/short-urls/helpers/QrCodeModal.tsx @@ -22,7 +22,7 @@ interface QrCodeModalConnectProps extends ShortUrlModalProps { selectedServer: SelectedServer; } -const QrCodeModal = (imageDownloader: ImageDownloader, ForServerVersion: FC) => ( // eslint-disable-line +const QrCodeModal = (imageDownloader: ImageDownloader, ForServerVersion: FC) => ( { shortUrl: { shortUrl, shortCode }, toggle, isOpen, selectedServer }: QrCodeModalConnectProps, ) => { const [size, setSize] = useState(300); diff --git a/src/utils/helpers/hooks.ts b/src/utils/helpers/hooks.ts index 9ad034f6..7b816373 100644 --- a/src/utils/helpers/hooks.ts +++ b/src/utils/helpers/hooks.ts @@ -36,7 +36,7 @@ export const useToggle = (initialValue = false): ToggleResult => { export const useSwipeable = (showSidebar: () => void, hideSidebar: () => void) => { 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'), ); diff --git a/src/visits/types/helpers.ts b/src/visits/types/helpers.ts index 0b449968..04509d03 100644 --- a/src/visits/types/helpers.ts +++ b/src/visits/types/helpers.ts @@ -31,7 +31,7 @@ export const highlightedVisitsToStats = ( export const toApiParams = ({ page, itemsPerPage, filter, dateRange }: VisitsParams): ShlinkVisitsParams => { const startDate = (dateRange?.startDate && formatIsoDate(dateRange?.startDate)) ?? 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 }; }; diff --git a/test/app/App.test.tsx b/test/app/App.test.tsx index 8e72b7ef..ce03225a 100644 --- a/test/app/App.test.tsx +++ b/test/app/App.test.tsx @@ -73,7 +73,7 @@ describe('', () => { ['/bar', 'shlink-wrapper'], ['/', 'shlink-wrapper d-flex d-md-block align-items-center'], ])('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 shlinkWrapper = wrapper.find('.shlink-wrapper'); diff --git a/test/common/services/ReportExporter.test.ts b/test/common/services/ReportExporter.test.ts index 300a2168..7c530175 100644 --- a/test/common/services/ReportExporter.test.ts +++ b/test/common/services/ReportExporter.test.ts @@ -12,7 +12,7 @@ describe('ReportExporter', () => { beforeEach(jest.clearAllMocks); 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: () => '' }; exporter = new ReportExporter(windowMock, csvToJsonMock); diff --git a/test/servers/helpers/ImportServersBtn.test.tsx b/test/servers/helpers/ImportServersBtn.test.tsx index 1aa4b8c1..636ff295 100644 --- a/test/servers/helpers/ImportServersBtn.test.tsx +++ b/test/servers/helpers/ImportServersBtn.test.tsx @@ -78,7 +78,7 @@ describe('', () => { const wrapper = createWrapper(); 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); }); diff --git a/test/servers/services/ServersExporter.test.ts b/test/servers/services/ServersExporter.test.ts index cfb69bad..e5d250d5 100644 --- a/test/servers/services/ServersExporter.test.ts +++ b/test/servers/services/ServersExporter.test.ts @@ -35,7 +35,7 @@ describe('ServersExporter', () => { beforeEach(() => { originalConsole = global.console; global.console = Mock.of({ 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: () => '' }; }); afterEach(() => { diff --git a/test/tags/helpers/DeleteTagConfirmModal.test.tsx b/test/tags/helpers/DeleteTagConfirmModal.test.tsx index 0ba07ea1..f9bb7925 100644 --- a/test/tags/helpers/DeleteTagConfirmModal.test.tsx +++ b/test/tags/helpers/DeleteTagConfirmModal.test.tsx @@ -58,7 +58,7 @@ describe('', () => { const footer = wrapper.find(ModalFooter); 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).toHaveBeenCalledWith(tag); diff --git a/test/tags/helpers/EditTagModal.test.tsx b/test/tags/helpers/EditTagModal.test.tsx index 286457c6..266f5d7a 100644 --- a/test/tags/helpers/EditTagModal.test.tsx +++ b/test/tags/helpers/EditTagModal.test.tsx @@ -83,7 +83,7 @@ describe('', () => { expect(editTag).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(tagEdited).toHaveBeenCalled();