From 75c41c07fdd8032718dab8f4c9fc81914b03c5d3 Mon Sep 17 00:00:00 2001 From: Nawaz Dhandala Date: Tue, 12 Apr 2022 14:27:30 +0100 Subject: [PATCH] fix --- Accounts/src/Reducers/index.ts | 2 +- Accounts/src/errors.ts | 2 +- AdminDashboard/src/Actions/project.ts | 4 ++-- AdminDashboard/src/Actions/settings.ts | 2 +- AdminDashboard/src/Reducers/dashboard.ts | 2 +- AdminDashboard/src/Reducers/index.ts | 2 +- AdminDashboard/src/Reducers/license.ts | 2 +- AdminDashboard/src/Reducers/modal.ts | 2 +- AdminDashboard/src/Reducers/notifications.ts | 2 +- AdminDashboard/src/Reducers/page.ts | 2 +- AdminDashboard/src/Reducers/version.ts | 2 +- AdminDashboard/src/Utils/booleanParser.ts | 2 +- AdminDashboard/src/Utils/keybinding.ts | 2 +- AdminDashboard/src/errors.ts | 2 +- Backend/api/Base.ts | 2 +- Backend/api/CallRouting.ts | 9 ++++++--- Backend/api/Search.ts | 2 +- Backend/api/StatusPage.ts | 4 ++-- Backend/utils/joinNames.ts | 2 +- Backend/utils/randomChar.ts | 2 +- Backend/workers/iotMonitor.ts | 2 +- Backend/workers/serverMonitor.ts | 2 +- CommonServer/Services/AlertService.ts | 4 ++-- CommonServer/Services/StatusPageService.ts | 2 +- CommonServer/Utils/Response.ts | 4 ++-- CommonServer/Utils/StartServer.ts | 4 ++-- CommonUI/src/reducers/modal.ts | 2 +- Dashboard/src/Actions/applicationLog.ts | 2 +- Dashboard/src/Actions/callRouting.ts | 4 ++-- Dashboard/src/Actions/emailTemplates.ts | 2 +- Dashboard/src/Actions/errorTracker.ts | 2 +- Dashboard/src/Actions/incident.ts | 6 +++--- Dashboard/src/Actions/monitor.ts | 2 +- Dashboard/src/Actions/project.ts | 2 +- Dashboard/src/Actions/resourceCategories.ts | 6 +++--- Dashboard/src/Actions/scheduledEvent.ts | 2 +- Dashboard/src/Actions/slackWebhook.ts | 2 +- Dashboard/src/Actions/statusPage.ts | 4 ++-- Dashboard/src/Reducers/alert.ts | 2 +- Dashboard/src/Reducers/animateSidebar.ts | 2 +- Dashboard/src/Reducers/feedback.ts | 2 +- Dashboard/src/Reducers/incidentBasicSettings.ts | 2 +- Dashboard/src/Reducers/incidentNoteTemplate.ts | 2 +- Dashboard/src/Reducers/incidentPriorities.ts | 2 +- Dashboard/src/Reducers/index.ts | 2 +- Dashboard/src/Reducers/modal.ts | 2 +- Dashboard/src/Reducers/msteams.ts | 2 +- Dashboard/src/Reducers/notifications.ts | 2 +- Dashboard/src/Reducers/onCallSchedule.ts | 2 +- Dashboard/src/Reducers/page.ts | 2 +- Dashboard/src/Reducers/slack.ts | 2 +- Dashboard/src/Reducers/slackWebhooks.ts | 2 +- Dashboard/src/Reducers/team.ts | 2 +- Dashboard/src/Reducers/tutorial.ts | 2 +- Dashboard/src/Reducers/version.ts | 2 +- Dashboard/src/Reducers/webHook.ts | 2 +- Dashboard/src/Utils/booleanParser.ts | 2 +- Dashboard/src/Utils/isMainProjectViewer.ts | 2 +- Dashboard/src/components/basic/HasProjectOwner.ts | 2 +- Dashboard/src/components/basic/Socket.ts | 2 +- Dashboard/src/errors.ts | 2 +- Home/config/product-compare.ts | 2 +- InitScript/util/randomChar.ts | 2 +- Probe/workers/incomingHttpRequestMonitors.ts | 2 +- Probe/workers/ipMonitors.ts | 2 +- Probe/workers/serverMonitors.ts | 2 +- ScriptRunner/utils/bash.ts | 2 +- StatusPage/src/Actions/status.ts | 8 ++++---- StatusPage/src/Components/basic/Socket.ts | 2 +- StatusPage/src/Reducer/index.ts | 2 +- StatusPage/src/Reducer/login.ts | 2 +- StatusPage/src/Reducer/status.ts | 2 +- StatusPage/src/Reducer/subscribe.ts | 2 +- StatusPage/src/config.ts | 4 ++-- StatusPage/src/errors.ts | 2 +- Tests/enterprise-tests/accounts/login.test.ts | 4 ++-- Tests/saas-tests/admin-dashboard/Sso.test.ts | 4 ++-- Tests/saas-tests/dashboard/StatusPage.test.ts | 2 +- Tests/saas-tests/dashboard/StatusPage2.test.ts | 2 +- Tests/saas-tests/dashboard/StatusPage3.test.ts | 2 +- _test/script-monitor/scriptSandbox.test.ts | 10 +++++----- _test/script-monitor/scriptSandbox.ts | 2 +- 82 files changed, 108 insertions(+), 105 deletions(-) diff --git a/Accounts/src/Reducers/index.ts b/Accounts/src/Reducers/index.ts index 903107526b..10dffc6312 100755 --- a/Accounts/src/Reducers/index.ts +++ b/Accounts/src/Reducers/index.ts @@ -21,7 +21,7 @@ const appReducer = combineReducers({ resendToken, }); -export default (state: RootState, action: Action) => { +export default (state: RootState, action: Action): void => { if (action.type === 'CLEAR_STORE') { state = undefined; } diff --git a/Accounts/src/errors.ts b/Accounts/src/errors.ts index fdf24afdb2..b540961f79 100755 --- a/Accounts/src/errors.ts +++ b/Accounts/src/errors.ts @@ -1,4 +1,4 @@ -export default (error: $TSFixMe) => { +export default (error: $TSFixMe): void => { switch (error.toString()) { case 'Error: Network Error': return 'Check your network connection.'; diff --git a/AdminDashboard/src/Actions/project.ts b/AdminDashboard/src/Actions/project.ts index d20bb5ba11..032a3e7264 100644 --- a/AdminDashboard/src/Actions/project.ts +++ b/AdminDashboard/src/Actions/project.ts @@ -922,7 +922,7 @@ export const fetchProjectDomains = ( projectId: string, skip = 0, limit = 10 -) => { +): void => { return async function (dispatch: Dispatch): void { dispatch(fetchProjectDomainsRequest()); @@ -1089,7 +1089,7 @@ export const resetUnverifyProjectDomain = (): void => { export const unVerifyProjectDomain = ( projectId: string, domainId: $TSFixMe -) => { +): void => { return async function (dispatch: Dispatch): void { dispatch(unVerifyProjectDomainRequest()); diff --git a/AdminDashboard/src/Actions/settings.ts b/AdminDashboard/src/Actions/settings.ts index beeeb04f9b..5b9ab2374c 100644 --- a/AdminDashboard/src/Actions/settings.ts +++ b/AdminDashboard/src/Actions/settings.ts @@ -11,7 +11,7 @@ export const requestingSettings = (): void => { export const requestingSettingsSucceeded = ( payload: $TSFixMe, payloadType: $TSFixMe -) => { +): void => { return { type: types.REQUESTING_SETTINGS_SUCCEEDED, payload, diff --git a/AdminDashboard/src/Reducers/dashboard.ts b/AdminDashboard/src/Reducers/dashboard.ts index ae55e940cc..8c4550279b 100644 --- a/AdminDashboard/src/Reducers/dashboard.ts +++ b/AdminDashboard/src/Reducers/dashboard.ts @@ -13,7 +13,7 @@ const initialState = { success: false, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case DASHBOARD_LOAD_REQUEST: return Object.assign({}, state, { diff --git a/AdminDashboard/src/Reducers/index.ts b/AdminDashboard/src/Reducers/index.ts index 1f0f6ca5fe..82d7d53cd1 100644 --- a/AdminDashboard/src/Reducers/index.ts +++ b/AdminDashboard/src/Reducers/index.ts @@ -43,7 +43,7 @@ const appReducer = combineReducers({ dashboard, }); -export default (state: RootState, action: Action) => { +export default (state: RootState, action: Action): void => { if (action.type === 'CLEAR_STORE') { state = undefined; } diff --git a/AdminDashboard/src/Reducers/license.ts b/AdminDashboard/src/Reducers/license.ts index 4c483a60c5..f670c40a33 100644 --- a/AdminDashboard/src/Reducers/license.ts +++ b/AdminDashboard/src/Reducers/license.ts @@ -25,7 +25,7 @@ const initialState = { }, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case FETCH_LICENSE_REQUEST: return Object.assign({}, state, { diff --git a/AdminDashboard/src/Reducers/modal.ts b/AdminDashboard/src/Reducers/modal.ts index 34817ef3ca..9520ca8233 100644 --- a/AdminDashboard/src/Reducers/modal.ts +++ b/AdminDashboard/src/Reducers/modal.ts @@ -7,7 +7,7 @@ const initialState = { feedbackModalVisble: false, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case OPEN_MODAL: return Object.assign({}, state, { diff --git a/AdminDashboard/src/Reducers/notifications.ts b/AdminDashboard/src/Reducers/notifications.ts index 17023ea14f..13e8fcae38 100644 --- a/AdminDashboard/src/Reducers/notifications.ts +++ b/AdminDashboard/src/Reducers/notifications.ts @@ -21,7 +21,7 @@ const initialState = { notificationsPosition: 0, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case OPEN_NOTIFICATION_MENU: return Object.assign({}, state, { diff --git a/AdminDashboard/src/Reducers/page.ts b/AdminDashboard/src/Reducers/page.ts index 572410dffa..63df9988b5 100755 --- a/AdminDashboard/src/Reducers/page.ts +++ b/AdminDashboard/src/Reducers/page.ts @@ -12,7 +12,7 @@ const initialState = { sidenavopen: false, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case PAGE_LOAD_REQUEST: return Object.assign({}, state, { diff --git a/AdminDashboard/src/Reducers/version.ts b/AdminDashboard/src/Reducers/version.ts index 8e6d56f0a9..b17ec56136 100644 --- a/AdminDashboard/src/Reducers/version.ts +++ b/AdminDashboard/src/Reducers/version.ts @@ -20,7 +20,7 @@ const initialState = { }, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case GET_VERSION_FAILED: return Object.assign({}, state, { diff --git a/AdminDashboard/src/Utils/booleanParser.ts b/AdminDashboard/src/Utils/booleanParser.ts index daee096f24..9e6ead16af 100644 --- a/AdminDashboard/src/Utils/booleanParser.ts +++ b/AdminDashboard/src/Utils/booleanParser.ts @@ -4,7 +4,7 @@ * @returns Boolean true or false */ -export default (val: $TSFixMe) => { +export default (val: $TSFixMe): void => { const falsy = /^(?:f(?:alse)?|no?|0+)$/i; return !falsy.test(val) && !!val; }; diff --git a/AdminDashboard/src/Utils/keybinding.ts b/AdminDashboard/src/Utils/keybinding.ts index 726ac0e180..ed130c6842 100644 --- a/AdminDashboard/src/Utils/keybinding.ts +++ b/AdminDashboard/src/Utils/keybinding.ts @@ -16,7 +16,7 @@ const keyBind = ( route: $TSFixMe, keys: $TSFixMe, resetKeys: $TSFixMe -) => { +): void => { let shortcut = []; // ensure the target is always body and not inside any other element (input, textarea, etc) if (route.shortcut && event.target.localName === 'body' && event.key) { diff --git a/AdminDashboard/src/errors.ts b/AdminDashboard/src/errors.ts index fdf24afdb2..b540961f79 100644 --- a/AdminDashboard/src/errors.ts +++ b/AdminDashboard/src/errors.ts @@ -1,4 +1,4 @@ -export default (error: $TSFixMe) => { +export default (error: $TSFixMe): void => { switch (error.toString()) { case 'Error: Network Error': return 'Check your network connection.'; diff --git a/Backend/api/Base.ts b/Backend/api/Base.ts index 61c3aa54fb..e95dbc8921 100644 --- a/Backend/api/Base.ts +++ b/Backend/api/Base.ts @@ -236,7 +236,7 @@ export default ({ req: ExpressRequest, res: ExpressResponse, next: NextFunction - ) => { + ): void => { req.apiProps = props; return next(); }; diff --git a/Backend/api/CallRouting.ts b/Backend/api/CallRouting.ts index 569d9403da..6b46c70e42 100644 --- a/Backend/api/CallRouting.ts +++ b/Backend/api/CallRouting.ts @@ -20,7 +20,7 @@ const router = express.getRouter(); import multer from 'multer'; import storage from '../middlewares/upload'; -const callForward = async (req: ExpressRequest, res: ExpressResponse) => { +const callForward = async (req: ExpressRequest, res: ExpressResponse): void => { try { const body = req.body; const to = body['To']; @@ -43,7 +43,10 @@ const callForward = async (req: ExpressRequest, res: ExpressResponse) => { } }; -const backupCallForward = async (req: ExpressRequest, res: ExpressResponse) => { +const backupCallForward = async ( + req: ExpressRequest, + res: ExpressResponse +): void => { try { const body = req.body; const to = body['To']; @@ -66,7 +69,7 @@ const backupCallForward = async (req: ExpressRequest, res: ExpressResponse) => { } }; -const callStatus = async (req: ExpressRequest, res: ExpressResponse) => { +const callStatus = async (req: ExpressRequest, res: ExpressResponse): void => { try { const body = req.body; const to = body['To']; diff --git a/Backend/api/Search.ts b/Backend/api/Search.ts index 4284d567e3..6fb5e53d78 100644 --- a/Backend/api/Search.ts +++ b/Backend/api/Search.ts @@ -249,7 +249,7 @@ const getStatusPages = async ( return null; }; -const getUsers = async (projectIds: $TSFixMe, val: $TSFixMe) => { +const getUsers = async (projectIds: $TSFixMe, val: $TSFixMe): void => { //get project users id so as to search for only users in a project and its subproject const projectUsers: $TSFixMe = []; diff --git a/Backend/api/StatusPage.ts b/Backend/api/StatusPage.ts index 5d8c696873..36b8690fe0 100755 --- a/Backend/api/StatusPage.ts +++ b/Backend/api/StatusPage.ts @@ -1384,7 +1384,7 @@ router.get( } ); -const fetchNotes = async (events: $TSFixMe, limit: PositiveNumber) => { +const fetchNotes = async (events: $TSFixMe, limit: PositiveNumber): void => { const updatedEvents = []; if (events.length > 0) { for (const event of events) { @@ -3007,7 +3007,7 @@ const filterProbeData = ( monitor: $TSFixMe, probe: $TSFixMe, backupStatus: $TSFixMe -) => { +): void => { const monitorStatuses = monitor?.statuses || backupStatus; const probesStatus = monitorStatuses && monitorStatuses.length > 0 diff --git a/Backend/utils/joinNames.ts b/Backend/utils/joinNames.ts index 0bbb40f917..9b826320e6 100644 --- a/Backend/utils/joinNames.ts +++ b/Backend/utils/joinNames.ts @@ -4,7 +4,7 @@ * @returns a string */ -export default (arr = []) => { +export default (arr = []): void => { if (!Array.isArray(arr)) return ''; return arr.join(', ').replace(/, ([^,]*)$/, ' and $1'); }; diff --git a/Backend/utils/randomChar.ts b/Backend/utils/randomChar.ts index 8670824274..380493ca4e 100644 --- a/Backend/utils/randomChar.ts +++ b/Backend/utils/randomChar.ts @@ -4,7 +4,7 @@ * @returns { string } a string of random characters */ -export default (num = 15) => { +export default (num = 15): void => { const input = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; let output = ''; diff --git a/Backend/workers/iotMonitor.ts b/Backend/workers/iotMonitor.ts index 7775c5bc68..84b7cff4db 100755 --- a/Backend/workers/iotMonitor.ts +++ b/Backend/workers/iotMonitor.ts @@ -25,7 +25,7 @@ export default { }, }; -const job = async (monitor: $TSFixMe, res: $TSFixMe) => { +const job = async (monitor: $TSFixMe, res: $TSFixMe): void => { const populate = [ { path: 'monitors.monitorId', diff --git a/Backend/workers/serverMonitor.ts b/Backend/workers/serverMonitor.ts index a299d0ca48..1c3f295fc9 100644 --- a/Backend/workers/serverMonitor.ts +++ b/Backend/workers/serverMonitor.ts @@ -38,7 +38,7 @@ export default { }, }; -const job = async (monitor: $TSFixMe) => { +const job = async (monitor: $TSFixMe): void => { const { stat: validUp, successReasons } = monitor && monitor.criteria && monitor.criteria.up ? ProbeService.conditions(monitor.type, monitor.criteria.up) diff --git a/CommonServer/Services/AlertService.ts b/CommonServer/Services/AlertService.ts index 50c3d7732e..3951426b00 100755 --- a/CommonServer/Services/AlertService.ts +++ b/CommonServer/Services/AlertService.ts @@ -3053,7 +3053,7 @@ export default class Service { let webhookNotificationSent = true; - const sendAlerts = async () => { + const sendAlerts = async (): void => { if (subscriber.alertVia === AlertType.Webhook) { const investigationNoteNotificationWebhookDisabled = isStatusPageNoteAlert && @@ -4587,7 +4587,7 @@ export default class Service { ? 'Scheduled maintenance resolved' : 'Scheduled maintenance cancelled'; - const sendAlerts = async () => { + const sendAlerts = async (): void => { if (subscriber.alertVia === AlertType.Email) { const [ hasGlobalSmtpSettings, diff --git a/CommonServer/Services/StatusPageService.ts b/CommonServer/Services/StatusPageService.ts index f796e8cc73..e11d2d529b 100755 --- a/CommonServer/Services/StatusPageService.ts +++ b/CommonServer/Services/StatusPageService.ts @@ -1496,7 +1496,7 @@ export default class Service { } async isPermitted(userId: string, statusPage: $TSFixMe): void { - const fn = async (resolve: $TSFixMe) => { + const fn = async (resolve: $TSFixMe): void => { if (statusPage.isPrivate) { if (userId) { const project = await ProjectService.findOneBy({ diff --git a/CommonServer/Utils/Response.ts b/CommonServer/Utils/Response.ts index 9fb34028a1..2b909e91af 100644 --- a/CommonServer/Utils/Response.ts +++ b/CommonServer/Utils/Response.ts @@ -52,7 +52,7 @@ function logResponse( export const sendEmptyResponse = ( req: ExpressRequest, res: ExpressResponse -) => { +): void => { const oneUptimeRequest: OneUptimeRequest = req as OneUptimeRequest; const oneUptimeResponse: OneUptimeResponse = res as OneUptimeResponse; @@ -92,7 +92,7 @@ export const sendErrorResponse = ( req: ExpressRequest, res: ExpressResponse, error: Exception -) => { +): void => { const oneUptimeRequest: OneUptimeRequest = req as OneUptimeRequest; const oneUptimeResponse: OneUptimeResponse = res as OneUptimeResponse; diff --git a/CommonServer/Utils/StartServer.ts b/CommonServer/Utils/StartServer.ts index c7d50c5770..70620414d4 100644 --- a/CommonServer/Utils/StartServer.ts +++ b/CommonServer/Utils/StartServer.ts @@ -22,7 +22,7 @@ const logRequest = ( req: ExpressRequest, res: ExpressResponse, next: NextFunction -) => { +): void => { const current_datetime = new Date(); const formatted_date = current_datetime.getFullYear() + @@ -50,7 +50,7 @@ const setDefaultHeaders = ( req: ExpressRequest, res: ExpressResponse, next: NextFunction -) => { +): void => { if (typeof req.body === 'string') { req.body = JSON.parse(req.body); } diff --git a/CommonUI/src/reducers/modal.ts b/CommonUI/src/reducers/modal.ts index 9b854781f4..5cac6e98b4 100755 --- a/CommonUI/src/reducers/modal.ts +++ b/CommonUI/src/reducers/modal.ts @@ -13,7 +13,7 @@ const initialState: initialStateType = { modals: [], }; -export default (state = initialState, action: ModalAction) => { +export default (state = initialState, action: ModalAction): void => { switch (action.type) { case ModalConstant.OPEN_MODAL: { return Object.assign({}, state, { diff --git a/Dashboard/src/Actions/applicationLog.ts b/Dashboard/src/Actions/applicationLog.ts index f9ea616b71..4773bcd3ae 100644 --- a/Dashboard/src/Actions/applicationLog.ts +++ b/Dashboard/src/Actions/applicationLog.ts @@ -159,7 +159,7 @@ export function deleteApplicationLog( export const deleteApplicationLogSuccess = ( removedApplicationLogId: $TSFixMe -) => { +): void => { return { type: types.DELETE_APPLICATION_LOG_SUCCESS, payload: removedApplicationLogId, diff --git a/Dashboard/src/Actions/callRouting.ts b/Dashboard/src/Actions/callRouting.ts index f83090a77a..b2b3958f5f 100644 --- a/Dashboard/src/Actions/callRouting.ts +++ b/Dashboard/src/Actions/callRouting.ts @@ -478,7 +478,7 @@ export function removeIntroAudio( export const removeIntroAudioSuccess = ( numbers: $TSFixMe, backup: $TSFixMe -) => { +): void => { if (backup) { return { type: types.REMOVE_BACKUP_INTRO_AUDIO_SUCCESS, @@ -512,7 +512,7 @@ export function removeIntroAudioRequest( export const removeIntroAudioFailure = ( error: ErrorPayload, backup: $TSFixMe -) => { +): void => { if (backup) { return { type: types.REMOVE_BACKUP_INTRO_AUDIO_FAILURE, diff --git a/Dashboard/src/Actions/emailTemplates.ts b/Dashboard/src/Actions/emailTemplates.ts index 4e1d072aa1..405dbec705 100755 --- a/Dashboard/src/Actions/emailTemplates.ts +++ b/Dashboard/src/Actions/emailTemplates.ts @@ -119,7 +119,7 @@ export const resetEmailTemplatesSuccess = (emailTemplates: $TSFixMe): void => { export const resetEmailTemplates = ( projectId: string, templateId: $TSFixMe -) => { +): void => { return function (dispatch: Dispatch): void { const promise = BackendAPI.get( `emailTemplate/${projectId}/${templateId}/reset` diff --git a/Dashboard/src/Actions/errorTracker.ts b/Dashboard/src/Actions/errorTracker.ts index 3c4a9efe91..d62df862b9 100644 --- a/Dashboard/src/Actions/errorTracker.ts +++ b/Dashboard/src/Actions/errorTracker.ts @@ -762,7 +762,7 @@ export function deleteErrorTrackerIssueSuccess( export const deleteErrorTrackerIssueRequest = ( errorTrackerIssueId: $TSFixMe -) => { +): void => { return { type: types.DELETE_ERROR_TRACKER_ISSUE_REQUEST, payload: errorTrackerIssueId, diff --git a/Dashboard/src/Actions/incident.ts b/Dashboard/src/Actions/incident.ts index f835e9f60e..b3ce23dd9d 100755 --- a/Dashboard/src/Actions/incident.ts +++ b/Dashboard/src/Actions/incident.ts @@ -706,7 +706,7 @@ export const deleteProjectIncidents = (projectId: string): void => { export const investigationNoteRequest = ( promise: $TSFixMe, updated: $TSFixMe -) => { +): void => { return { type: types.INVESTIGATION_NOTE_REQUEST, payload: { promise, updated }, @@ -716,7 +716,7 @@ export const investigationNoteRequest = ( export const investigationNoteError = ( error: ErrorPayload, updated: $TSFixMe -) => { +): void => { return { type: types.INVESTIGATION_NOTE_FAILED, payload: { error, updated }, @@ -1049,7 +1049,7 @@ export function deleteIncidentMessage( export const deleteIncidentMessageSuccess = ( removedIncidentMessage: $TSFixMe -) => { +): void => { return { type: types.DELETE_INCIDENT_MESSAGE_SUCCESS, payload: removedIncidentMessage, diff --git a/Dashboard/src/Actions/monitor.ts b/Dashboard/src/Actions/monitor.ts index aff684311c..e14817b37b 100755 --- a/Dashboard/src/Actions/monitor.ts +++ b/Dashboard/src/Actions/monitor.ts @@ -566,7 +566,7 @@ export const changeMonitorComponent = ( projectId: string, monitorId: $TSFixMe, newComponentId: $TSFixMe -) => { +): void => { return async (dispatch: Dispatch) => { try { dispatch(changeMonitorComponentRequest(monitorId)); diff --git a/Dashboard/src/Actions/project.ts b/Dashboard/src/Actions/project.ts index ea660b1d17..156af96da9 100755 --- a/Dashboard/src/Actions/project.ts +++ b/Dashboard/src/Actions/project.ts @@ -1184,7 +1184,7 @@ export const fetchProjectDomains = ( projectId: string, skip = 0, limit = 10 -) => { +): void => { return async function (dispatch: Dispatch): void { dispatch(fetchProjectDomainsRequest()); diff --git a/Dashboard/src/Actions/resourceCategories.ts b/Dashboard/src/Actions/resourceCategories.ts index 42923f6ed2..91fa080928 100755 --- a/Dashboard/src/Actions/resourceCategories.ts +++ b/Dashboard/src/Actions/resourceCategories.ts @@ -39,7 +39,7 @@ export function fetchResourceCategories( export const fetchResourceCategoriesSuccess = ( resourceCategories: $TSFixMe -) => { +): void => { return { type: types.FETCH_RESOURCE_CATEGORIES_SUCCESS, payload: resourceCategories, @@ -132,7 +132,7 @@ export function updateResourceCategory( export const createResourceCategorySuccess = ( newResourceCategory: $TSFixMe -) => { +): void => { return { type: types.CREATE_RESOURCE_CATEGORY_SUCCESS, payload: newResourceCategory, @@ -262,7 +262,7 @@ export const fetchResourceCategoriesForNewResourceRequest = (): void => { export const fetchResourceCategoriesForNewResourceFailure = ( error: ErrorPayload -) => { +): void => { return { type: types.FETCH_RESOURCE_CATEGORIES_FOR_NEW_RESOURCE_FAILURE, payload: error, diff --git a/Dashboard/src/Actions/scheduledEvent.ts b/Dashboard/src/Actions/scheduledEvent.ts index 25025a2b71..6926a2a7f5 100755 --- a/Dashboard/src/Actions/scheduledEvent.ts +++ b/Dashboard/src/Actions/scheduledEvent.ts @@ -415,7 +415,7 @@ export function updateScheduledEvent( export const updateScheduledEventSuccess = ( updatedScheduledEvent: $TSFixMe -) => { +): void => { return { type: types.UPDATE_SCHEDULED_EVENT_SUCCESS, payload: updatedScheduledEvent, diff --git a/Dashboard/src/Actions/slackWebhook.ts b/Dashboard/src/Actions/slackWebhook.ts index 89eda2c4b3..823a703179 100644 --- a/Dashboard/src/Actions/slackWebhook.ts +++ b/Dashboard/src/Actions/slackWebhook.ts @@ -82,7 +82,7 @@ export const getSlack = ( projectId: string, skip: PositiveNumber, limit: PositiveNumber -) => { +): void => { return function (dispatch: Dispatch): void { let promise = null; promise = BackendAPI.get( diff --git a/Dashboard/src/Actions/statusPage.ts b/Dashboard/src/Actions/statusPage.ts index 3bb2c39416..75e8736654 100755 --- a/Dashboard/src/Actions/statusPage.ts +++ b/Dashboard/src/Actions/statusPage.ts @@ -261,7 +261,7 @@ export const updatePrivateStatusPageError = (error: ErrorPayload): void => { export const updatePrivateStatusPage = ( projectId: string, values: $TSFixMe -) => { +): void => { return function (dispatch: Dispatch): void { const promise = BackendAPI.put(`StatusPage/${projectId}`, values); dispatch(updatePrivateStatusPageRequest()); @@ -733,7 +733,7 @@ export const resetIncidentFetchStatusPages = (): void => { export const fetchIncidentStatusPagesSuccess = ( incidentStatusPages: $TSFixMe -) => { +): void => { return { type: types.FETCH_INCIDENT_STATUSPAGE_SUCCESS, payload: incidentStatusPages, diff --git a/Dashboard/src/Reducers/alert.ts b/Dashboard/src/Reducers/alert.ts index 6d2a437ac9..588cbdae64 100755 --- a/Dashboard/src/Reducers/alert.ts +++ b/Dashboard/src/Reducers/alert.ts @@ -48,7 +48,7 @@ const initialState = { }, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case types.ALERT_FETCH_SUCCESS: return Object.assign({}, state, { diff --git a/Dashboard/src/Reducers/animateSidebar.ts b/Dashboard/src/Reducers/animateSidebar.ts index 82f3ae0a75..c8917dbabe 100644 --- a/Dashboard/src/Reducers/animateSidebar.ts +++ b/Dashboard/src/Reducers/animateSidebar.ts @@ -6,7 +6,7 @@ const initialState = { animateSidebar: false, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case ANIMATE_SIDEBAR: return Object.assign({}, state, { diff --git a/Dashboard/src/Reducers/feedback.ts b/Dashboard/src/Reducers/feedback.ts index aa078598f6..bd9713c281 100755 --- a/Dashboard/src/Reducers/feedback.ts +++ b/Dashboard/src/Reducers/feedback.ts @@ -18,7 +18,7 @@ const initialState = { feedbackModalVisble: false, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case OPEN_FEEDBACK_MODAL: return Object.assign({}, state, { diff --git a/Dashboard/src/Reducers/incidentBasicSettings.ts b/Dashboard/src/Reducers/incidentBasicSettings.ts index a69abe403d..0bde273f7d 100644 --- a/Dashboard/src/Reducers/incidentBasicSettings.ts +++ b/Dashboard/src/Reducers/incidentBasicSettings.ts @@ -72,7 +72,7 @@ const INITIAL_STATE = { }, }; -export default (state = INITIAL_STATE, action: Action) => { +export default (state = INITIAL_STATE, action: Action): void => { switch (action.type) { case FETCH_INCIDENT_BASIC_SETTINGS_VARIABLES_REQUEST: return Object.assign({}, state, { diff --git a/Dashboard/src/Reducers/incidentNoteTemplate.ts b/Dashboard/src/Reducers/incidentNoteTemplate.ts index 6fa708dd2a..48e0ef2e14 100644 --- a/Dashboard/src/Reducers/incidentNoteTemplate.ts +++ b/Dashboard/src/Reducers/incidentNoteTemplate.ts @@ -29,7 +29,7 @@ const initialState = { }, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case types.FETCH_INCIDENT_NOTE_TEMPLATES_REQUEST: return { diff --git a/Dashboard/src/Reducers/incidentPriorities.ts b/Dashboard/src/Reducers/incidentPriorities.ts index 1a498e7793..5626fada91 100644 --- a/Dashboard/src/Reducers/incidentPriorities.ts +++ b/Dashboard/src/Reducers/incidentPriorities.ts @@ -46,7 +46,7 @@ const INITIAL_STATE = { }, }; -export default (state = INITIAL_STATE, action: Action) => { +export default (state = INITIAL_STATE, action: Action): void => { let incidentPriorities, count, index; switch (action.type) { case FETCH_INCIDENT_PRIORITIES_SUCCESS: diff --git a/Dashboard/src/Reducers/index.ts b/Dashboard/src/Reducers/index.ts index 9471971c6e..7ac37a0a0e 100755 --- a/Dashboard/src/Reducers/index.ts +++ b/Dashboard/src/Reducers/index.ts @@ -118,7 +118,7 @@ const appReducer = combineReducers({ // Global Actions. -export default (state: RootState, action: Action) => { +export default (state: RootState, action: Action): void => { if (action.type === 'CLEAR_STORE') { state = undefined; } diff --git a/Dashboard/src/Reducers/modal.ts b/Dashboard/src/Reducers/modal.ts index a8fb5dd111..3ab69ead9e 100755 --- a/Dashboard/src/Reducers/modal.ts +++ b/Dashboard/src/Reducers/modal.ts @@ -7,7 +7,7 @@ const initialState = { feedbackModalVisble: false, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case OPEN_MODAL: return Object.assign({}, state, { diff --git a/Dashboard/src/Reducers/msteams.ts b/Dashboard/src/Reducers/msteams.ts index 3a82d18368..8835f60c97 100644 --- a/Dashboard/src/Reducers/msteams.ts +++ b/Dashboard/src/Reducers/msteams.ts @@ -52,7 +52,7 @@ const initialState = { }, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { let msTeams, index, count; switch (action.type) { case GET_MS_TEAMS_FAILED: diff --git a/Dashboard/src/Reducers/notifications.ts b/Dashboard/src/Reducers/notifications.ts index 93f361365a..12f018d1e6 100755 --- a/Dashboard/src/Reducers/notifications.ts +++ b/Dashboard/src/Reducers/notifications.ts @@ -24,7 +24,7 @@ const initialState = { notificationsPosition: 0, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case OPEN_NOTIFICATION_MENU: return Object.assign({}, state, { diff --git a/Dashboard/src/Reducers/onCallSchedule.ts b/Dashboard/src/Reducers/onCallSchedule.ts index 7c2d5c2c93..d812a59c78 100644 --- a/Dashboard/src/Reducers/onCallSchedule.ts +++ b/Dashboard/src/Reducers/onCallSchedule.ts @@ -9,7 +9,7 @@ const initialState = { onCallScheduleModalVisble: false, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case OPEN_ONCALLSCHEDULE_MODAL: return Object.assign({}, state, { diff --git a/Dashboard/src/Reducers/page.ts b/Dashboard/src/Reducers/page.ts index b6c107a296..0f3f2bdac4 100755 --- a/Dashboard/src/Reducers/page.ts +++ b/Dashboard/src/Reducers/page.ts @@ -14,7 +14,7 @@ const initialState = { toggleProjectSettingsMore: false, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case PAGE_LOAD_REQUEST: return Object.assign({}, state, { diff --git a/Dashboard/src/Reducers/slack.ts b/Dashboard/src/Reducers/slack.ts index aa4305528e..4800e7c3ca 100755 --- a/Dashboard/src/Reducers/slack.ts +++ b/Dashboard/src/Reducers/slack.ts @@ -31,7 +31,7 @@ const initialState = { }, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { let teams, index, count; switch (action.type) { case GET_SLACK_TEAM_FAILED: diff --git a/Dashboard/src/Reducers/slackWebhooks.ts b/Dashboard/src/Reducers/slackWebhooks.ts index 09f44446bc..9e9a3c0bd9 100644 --- a/Dashboard/src/Reducers/slackWebhooks.ts +++ b/Dashboard/src/Reducers/slackWebhooks.ts @@ -52,7 +52,7 @@ const initialState = { }, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { let slacks, index, count; switch (action.type) { case GET_SLACK_WEBHOOK_FAILED: diff --git a/Dashboard/src/Reducers/team.ts b/Dashboard/src/Reducers/team.ts index 471a3928b1..bf81922d31 100755 --- a/Dashboard/src/Reducers/team.ts +++ b/Dashboard/src/Reducers/team.ts @@ -64,7 +64,7 @@ const initialState = { pages: {}, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case TEAM_LOADING_REQUEST: return { diff --git a/Dashboard/src/Reducers/tutorial.ts b/Dashboard/src/Reducers/tutorial.ts index 95bb8dcc83..31f20ec8b6 100644 --- a/Dashboard/src/Reducers/tutorial.ts +++ b/Dashboard/src/Reducers/tutorial.ts @@ -35,7 +35,7 @@ const initialState = { }, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case FETCH_TUTORIAL_REQUEST: return Object.assign({}, state, { diff --git a/Dashboard/src/Reducers/version.ts b/Dashboard/src/Reducers/version.ts index 1786d72b05..059500f1d4 100644 --- a/Dashboard/src/Reducers/version.ts +++ b/Dashboard/src/Reducers/version.ts @@ -19,7 +19,7 @@ const initialState = { }, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { switch (action.type) { case GET_VERSION_FAILED: return Object.assign({}, state, { diff --git a/Dashboard/src/Reducers/webHook.ts b/Dashboard/src/Reducers/webHook.ts index 118a8b6765..aa9190053c 100755 --- a/Dashboard/src/Reducers/webHook.ts +++ b/Dashboard/src/Reducers/webHook.ts @@ -52,7 +52,7 @@ const initialState = { }, }; -export default (state = initialState, action: Action) => { +export default (state = initialState, action: Action): void => { let webHooks, index, count; switch (action.type) { case GET_WEB_HOOK_FAILED: diff --git a/Dashboard/src/Utils/booleanParser.ts b/Dashboard/src/Utils/booleanParser.ts index daee096f24..9e6ead16af 100644 --- a/Dashboard/src/Utils/booleanParser.ts +++ b/Dashboard/src/Utils/booleanParser.ts @@ -4,7 +4,7 @@ * @returns Boolean true or false */ -export default (val: $TSFixMe) => { +export default (val: $TSFixMe): void => { const falsy = /^(?:f(?:alse)?|no?|0+)$/i; return !falsy.test(val) && !!val; }; diff --git a/Dashboard/src/Utils/isMainProjectViewer.ts b/Dashboard/src/Utils/isMainProjectViewer.ts index 5f25a2d160..cf7f446d3c 100644 --- a/Dashboard/src/Utils/isMainProjectViewer.ts +++ b/Dashboard/src/Utils/isMainProjectViewer.ts @@ -8,7 +8,7 @@ const isMainProjectViewer = ( userId: string, subProjects: $TSFixMe, currentProject: $TSFixMe -) => { +): void => { let user = currentProject ? currentProject.users.find((user: $TSFixMe) => user.userId === userId) : null; diff --git a/Dashboard/src/components/basic/HasProjectOwner.ts b/Dashboard/src/components/basic/HasProjectOwner.ts index 0c49c52f09..bd566c031c 100644 --- a/Dashboard/src/components/basic/HasProjectOwner.ts +++ b/Dashboard/src/components/basic/HasProjectOwner.ts @@ -6,7 +6,7 @@ const HasProjectOwner = ( project: $TSFixMe, projectId: string, subProjects: $TSFixMe -) => { +): void => { if (project._id === projectId) { return ( project && diff --git a/Dashboard/src/components/basic/Socket.ts b/Dashboard/src/components/basic/Socket.ts index eab51ccb80..1ba14ecc7c 100755 --- a/Dashboard/src/components/basic/Socket.ts +++ b/Dashboard/src/components/basic/Socket.ts @@ -56,7 +56,7 @@ interface ComponentProps { } class SocketApp extends Component { - override shouldComponentUpdate(nextProps: ComponentProps) { + override shouldComponentUpdate(nextProps: ComponentProps): boolean { if ( this.props.project !== nextProps.project || this.props.activeProjectId !== nextProps.activeProjectId diff --git a/Dashboard/src/errors.ts b/Dashboard/src/errors.ts index fdf24afdb2..b540961f79 100755 --- a/Dashboard/src/errors.ts +++ b/Dashboard/src/errors.ts @@ -1,4 +1,4 @@ -export default (error: $TSFixMe) => { +export default (error: $TSFixMe): void => { switch (error.toString()) { case 'Error: Network Error': return 'Check your network connection.'; diff --git a/Home/config/product-compare.ts b/Home/config/product-compare.ts index b6a218c361..6c149f9c0b 100644 --- a/Home/config/product-compare.ts +++ b/Home/config/product-compare.ts @@ -1,6 +1,6 @@ import { JSONObject } from 'Common/Types/JSON'; -export default (product: string) => { +export default (product: string): void => { const products: JSONObject = { pagerduty: { productName: 'PagerDuty', diff --git a/InitScript/util/randomChar.ts b/InitScript/util/randomChar.ts index 8670824274..380493ca4e 100644 --- a/InitScript/util/randomChar.ts +++ b/InitScript/util/randomChar.ts @@ -4,7 +4,7 @@ * @returns { string } a string of random characters */ -export default (num = 15) => { +export default (num = 15): void => { const input = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; let output = ''; diff --git a/Probe/workers/incomingHttpRequestMonitors.ts b/Probe/workers/incomingHttpRequestMonitors.ts index faa38e6d19..9b4887dd7b 100644 --- a/Probe/workers/incomingHttpRequestMonitors.ts +++ b/Probe/workers/incomingHttpRequestMonitors.ts @@ -30,7 +30,7 @@ export default { }, }; -const checkCondition = async (condition: $TSFixMe) => { +const checkCondition = async (condition: $TSFixMe): void => { let response = false; if (condition && condition.and && condition.and.length) { for (let i = 0; i < condition.and.length; i++) { diff --git a/Probe/workers/ipMonitors.ts b/Probe/workers/ipMonitors.ts index f56f1d526f..5163a15003 100644 --- a/Probe/workers/ipMonitors.ts +++ b/Probe/workers/ipMonitors.ts @@ -35,7 +35,7 @@ export default { }, }; -const pingfetch = async (IPAddress: $TSFixMe) => { +const pingfetch = async (IPAddress: $TSFixMe): void => { const now = new Date().getTime(); let resp = null; let rawResp = null; diff --git a/Probe/workers/serverMonitors.ts b/Probe/workers/serverMonitors.ts index 20fb0480e7..b98dcdb496 100644 --- a/Probe/workers/serverMonitors.ts +++ b/Probe/workers/serverMonitors.ts @@ -90,7 +90,7 @@ export default { }, }; -const execCommands = async (exec: $TSFixMe, os: $TSFixMe) => { +const execCommands = async (exec: $TSFixMe, os: $TSFixMe): void => { const isSSH = exec instanceof NodeSSH; // TODO: complete commands and make platform specific diff --git a/ScriptRunner/utils/bash.ts b/ScriptRunner/utils/bash.ts index 80a342006a..cf6a99436c 100644 --- a/ScriptRunner/utils/bash.ts +++ b/ScriptRunner/utils/bash.ts @@ -1,7 +1,7 @@ import { exec } from 'child_process'; import { performance } from 'perf_hooks'; -const run = async (script: $TSFixMe) => { +const run = async (script: $TSFixMe): void => { const start = performance.now(); return new Promise(resolve => { exec(script, (err, stdout) => { diff --git a/StatusPage/src/Actions/status.ts b/StatusPage/src/Actions/status.ts index 7610e869c0..fdde4d70d7 100755 --- a/StatusPage/src/Actions/status.ts +++ b/StatusPage/src/Actions/status.ts @@ -72,7 +72,7 @@ export const getAllStatusPageResource = ( statusPageSlug: $TSFixMe, url: URL, range: $TSFixMe -) => { +): void => { return function (dispatch: Dispatch): void { const promises = []; @@ -640,7 +640,7 @@ export const notmonitoredDays = ( date: $TSFixMe, name: $TSFixMe, message: $TSFixMe -) => { +): void => { return function (dispatch: Dispatch): void { dispatch(statusPageNoteReset()); dispatch( @@ -680,7 +680,7 @@ export const getMoreNote = ( projectId: string, statusPageSlug: $TSFixMe, skip: PositiveNumber -) => { +): void => { return function (dispatch: Dispatch): void { const promise = BackendAPI.get( `StatusPage/${projectId}/${statusPageSlug}/notes?skip=${skip}` @@ -733,7 +733,7 @@ export const getMoreEvent = ( projectId: string, statusPageSlug: $TSFixMe, skip: PositiveNumber -) => { +): void => { return function (dispatch: Dispatch): void { const promise = BackendAPI.get( `StatusPage/${projectId}/${statusPageSlug}/events?skip=${skip}` diff --git a/StatusPage/src/Components/basic/Socket.ts b/StatusPage/src/Components/basic/Socket.ts index b30996cb20..209e8cbb3a 100644 --- a/StatusPage/src/Components/basic/Socket.ts +++ b/StatusPage/src/Components/basic/Socket.ts @@ -43,7 +43,7 @@ class SocketApp extends Component { public static displayName = ''; public static propTypes = {}; - override shouldComponentUpdate(nextProps: ComponentProps) { + override shouldComponentUpdate(nextProps: ComponentProps): boolean { if (this.props.project !== nextProps.project) { if (this.props.project) { socket.removeListener( diff --git a/StatusPage/src/Reducer/index.ts b/StatusPage/src/Reducer/index.ts index 88bae7d1bb..da37c2e045 100755 --- a/StatusPage/src/Reducer/index.ts +++ b/StatusPage/src/Reducer/index.ts @@ -9,7 +9,7 @@ import subscribe from './subscribe'; const appReducer = combineReducers({ form, login, status, probe, subscribe }); -export default (state: RootState, action: Action) => { +export default (state: RootState, action: Action): void => { if (action.type === 'CLEAR_STORE') { state = undefined; } diff --git a/StatusPage/src/Reducer/login.ts b/StatusPage/src/Reducer/login.ts index 4069e2d94a..06c0b2d711 100755 --- a/StatusPage/src/Reducer/login.ts +++ b/StatusPage/src/Reducer/login.ts @@ -15,7 +15,7 @@ const INITIAL_STATE = { error: false, }; -export default (state = INITIAL_STATE, action: Action) => { +export default (state = INITIAL_STATE, action: Action): void => { switch (action.type) { case LOGIN_REQUIRED: return Object.assign({}, state, { diff --git a/StatusPage/src/Reducer/status.ts b/StatusPage/src/Reducer/status.ts index fd1a7d74db..56a38876a4 100755 --- a/StatusPage/src/Reducer/status.ts +++ b/StatusPage/src/Reducer/status.ts @@ -241,7 +241,7 @@ const INITIAL_STATE = { }, }; -export default (state = INITIAL_STATE, action: Action) => { +export default (state = INITIAL_STATE, action: Action): void => { let monitorTimeRequest: $TSFixMe; let monitorTimeSuccess: $TSFixMe; switch (action.type) { diff --git a/StatusPage/src/Reducer/subscribe.ts b/StatusPage/src/Reducer/subscribe.ts index db83eb4b57..3cd98fe346 100755 --- a/StatusPage/src/Reducer/subscribe.ts +++ b/StatusPage/src/Reducer/subscribe.ts @@ -29,7 +29,7 @@ const INITIAL_STATE = { }, }; -export default (state = INITIAL_STATE, action: Action) => { +export default (state = INITIAL_STATE, action: Action): void => { switch (action.type) { case OPEN_SUBSCRIBE_MENU: return Object.assign({}, state, { diff --git a/StatusPage/src/config.ts b/StatusPage/src/config.ts index 6123875a0a..8c9d4d6e2e 100755 --- a/StatusPage/src/config.ts +++ b/StatusPage/src/config.ts @@ -151,7 +151,7 @@ export const filterProbeData = ( monitor: $TSFixMe, probe: $TSFixMe, backupStatus: $TSFixMe -) => { +): void => { const monitorStatuses = monitor.statuses || backupStatus; const probesStatus = @@ -262,7 +262,7 @@ export const capitalize = (words: $TSFixMe): void => { export const handleResources = ( monitorState: $TSFixMe, announcement: $TSFixMe -) => { +): void => { const affectedMonitors: $TSFixMe = []; let monitorCount = 0; diff --git a/StatusPage/src/errors.ts b/StatusPage/src/errors.ts index fdf24afdb2..b540961f79 100755 --- a/StatusPage/src/errors.ts +++ b/StatusPage/src/errors.ts @@ -1,4 +1,4 @@ -export default (error: $TSFixMe) => { +export default (error: $TSFixMe): void => { switch (error.toString()) { case 'Error: Network Error': return 'Check your network connection.'; diff --git a/Tests/enterprise-tests/accounts/login.test.ts b/Tests/enterprise-tests/accounts/login.test.ts index 2b22427f46..43ddb194a3 100644 --- a/Tests/enterprise-tests/accounts/login.test.ts +++ b/Tests/enterprise-tests/accounts/login.test.ts @@ -8,7 +8,7 @@ const operationTimeOut = init.timeout; const email = utils.generateRandomBusinessEmail(); const password = '1234567890'; -const moveToSsoPage = async (page: $TSFixMe) => { +const moveToSsoPage = async (page: $TSFixMe): void => { await init.pageWaitForSelector(page, '#settings', { visible: true, timeout: init.timeout, @@ -21,7 +21,7 @@ const moveToSsoPage = async (page: $TSFixMe) => { await init.pageClick(page, '#sso'); }; -const createSso = async (page: $TSFixMe, data: $TSFixMe) => { +const createSso = async (page: $TSFixMe, data: $TSFixMe): void => { await init.pageWaitForSelector(page, '#add-sso', { visible: true, timeout: init.timeout, diff --git a/Tests/saas-tests/admin-dashboard/Sso.test.ts b/Tests/saas-tests/admin-dashboard/Sso.test.ts index 0d8905ee3f..df59626336 100644 --- a/Tests/saas-tests/admin-dashboard/Sso.test.ts +++ b/Tests/saas-tests/admin-dashboard/Sso.test.ts @@ -9,7 +9,7 @@ import 'should'; const email = 'masteradmin@hackerbay.io'; const password = '1234567890'; -const moveToSsoPage = async (page: $TSFixMe) => { +const moveToSsoPage = async (page: $TSFixMe): void => { await init.pageWaitForSelector(page, '#settings'); await init.pageClick(page, '#settings'); @@ -19,7 +19,7 @@ const moveToSsoPage = async (page: $TSFixMe) => { await init.pageClick(page, '#sso'); }; -const createSso = async (page: $TSFixMe, data: $TSFixMe) => { +const createSso = async (page: $TSFixMe, data: $TSFixMe): void => { await init.pageClick(page, '#add-sso'); await init.pageWaitForSelector(page, '#save-button'); diff --git a/Tests/saas-tests/dashboard/StatusPage.test.ts b/Tests/saas-tests/dashboard/StatusPage.test.ts index 710424c8fb..c86c4d91fb 100644 --- a/Tests/saas-tests/dashboard/StatusPage.test.ts +++ b/Tests/saas-tests/dashboard/StatusPage.test.ts @@ -12,7 +12,7 @@ const monitorName = 'oneuptime'; const monitorName1 = 'testoneuptime'; let browser: $TSFixMe, page: $TSFixMe; -const gotoTheFirstStatusPage = async (page: $TSFixMe) => { +const gotoTheFirstStatusPage = async (page: $TSFixMe): void => { await page.goto(utils.DASHBOARD_URL, { waitUntil: ['networkidle2'], }); diff --git a/Tests/saas-tests/dashboard/StatusPage2.test.ts b/Tests/saas-tests/dashboard/StatusPage2.test.ts index 7dd076a611..e998a73ad6 100644 --- a/Tests/saas-tests/dashboard/StatusPage2.test.ts +++ b/Tests/saas-tests/dashboard/StatusPage2.test.ts @@ -13,7 +13,7 @@ const monitorName1 = 'testoneuptime'; const customDomain = utils.generateRandomString(); let browser: $TSFixMe, page: $TSFixMe; -const gotoTheFirstStatusPage = async (page: $TSFixMe) => { +const gotoTheFirstStatusPage = async (page: $TSFixMe): void => { await page.goto(utils.DASHBOARD_URL, { waitUntil: ['networkidle2'], timeout: init.timeout, diff --git a/Tests/saas-tests/dashboard/StatusPage3.test.ts b/Tests/saas-tests/dashboard/StatusPage3.test.ts index a92e56b026..cfe71e1026 100644 --- a/Tests/saas-tests/dashboard/StatusPage3.test.ts +++ b/Tests/saas-tests/dashboard/StatusPage3.test.ts @@ -13,7 +13,7 @@ const monitorName1 = 'testoneuptime'; const customDomain = `${utils.generateRandomString()}.com`; let browser: $TSFixMe, page: $TSFixMe; -const gotoTheFirstStatusPage = async (page: $TSFixMe) => { +const gotoTheFirstStatusPage = async (page: $TSFixMe): void => { await page.goto(utils.DASHBOARD_URL, { waitUntil: ['networkidle2'], }); diff --git a/_test/script-monitor/scriptSandbox.test.ts b/_test/script-monitor/scriptSandbox.test.ts index 0d7a26afc8..66629b4d73 100644 --- a/_test/script-monitor/scriptSandbox.test.ts +++ b/_test/script-monitor/scriptSandbox.test.ts @@ -28,7 +28,7 @@ describe('ScriptMonitor V2', function ():void { it("should return success for a valid script", async function ():void { - const someFunction = async (done: $TSFixMe) => { + const someFunction = async (done: $TSFixMe): void => { @@ -52,7 +52,7 @@ describe('ScriptMonitor V2', function ():void { it("should return false for error thrown in script", async function ():void { - const someFunction = async (done: $TSFixMe) => { + const someFunction = async (done: $TSFixMe): void => { console.log('Error log'); logger.error('Bad Error'); throw new Error("Bad error"); @@ -73,7 +73,7 @@ describe('ScriptMonitor V2', function ():void { it("should return scriptMonitor error when script returns a value in cb", async function ():void { - const someFunction = async (done: $TSFixMe) => { + const someFunction = async (done: $TSFixMe): void => { done("Some Error"); } const result = await runScript(someFunction.toString(), true); @@ -89,7 +89,7 @@ describe('ScriptMonitor V2', function ():void { it("should return timeout error when script takes too long", async function ():void { - const someFunction = async (done: $TSFixMe) => { + const someFunction = async (done: $TSFixMe): void => { return new Promise((resolve) => { setTimeout(() => "All timed out", 7000); }) @@ -106,7 +106,7 @@ describe('ScriptMonitor V2', function ():void { it("should return timeout error when statement takes too long", async function ():void { - const someFunction = async (done: $TSFixMe) => { + const someFunction = async (done: $TSFixMe): void => { while (true) { // statement stuck in loop or too busy } diff --git a/_test/script-monitor/scriptSandbox.ts b/_test/script-monitor/scriptSandbox.ts index 78b0f6e172..1d7bd447ec 100644 --- a/_test/script-monitor/scriptSandbox.ts +++ b/_test/script-monitor/scriptSandbox.ts @@ -36,7 +36,7 @@ const { maxSyncStatementDuration, } = runConfig; -const runScript = async (functionCode: $TSFixMe, isCalled: $TSFixMe, options = { maxScriptRunTime, maxSyncStatementDuration }) => { +const runScript = async (functionCode: $TSFixMe, isCalled: $TSFixMe, options = { maxScriptRunTime, maxSyncStatementDuration }): void => { if (isMainThread) {