Skip to content

Commit b927795

Browse files
authored
Merge pull request #1372 from Arnei/eslint-require-await
Activate eslint require-await
2 parents 5fa0465 + 44d3437 commit b927795

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+146
-133
lines changed

eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export default [
1717
"@typescript-eslint/no-explicit-any": "off",
1818
"@typescript-eslint/no-floating-promises": "off",
1919
"@typescript-eslint/no-misused-promises": "off",
20-
"@typescript-eslint/require-await": "off",
2120
},
2221
},
2322
];

src/components/events/partials/EventsStatusCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const EventsStatusCell = ({
2828
}
2929

3030
dispatch(fetchWorkflows(row.id)).unwrap()
31-
.then(async workflows => {
31+
.then(workflows => {
3232
// Open workflow overview modal if no workflows available
3333
if (!workflows.entries.length) {
3434
return dispatch(openModal(EventDetailsPage.Workflow, row));

src/components/events/partials/ModalTabsAndPages/EditScheduledEventsEditPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,10 @@ const EditScheduledEventsEditPage = <T extends RequiredFormProps>({
399399
<WizardNavigationButtons
400400
formik={formik}
401401
nextPage={
402-
async () => {
402+
() => {
403403
dispatch(removeNotificationWizardForm());
404404
if (
405-
await checkSchedulingConflicts(
405+
checkSchedulingConflicts(
406406
formik.values,
407407
setConflicts,
408408
dispatch,

src/components/events/partials/ModalTabsAndPages/EventDetailsSchedulingTab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ const EventDetailsSchedulingTab = ({
179179
};
180180

181181
// submits the formik form
182-
const submitForm = async (values: SchedulingInfo) => {
182+
const submitForm = (values: SchedulingInfo) => {
183183
dispatch(removeNotificationWizardForm());
184184
const startDate = makeDate(
185185
values.scheduleStartDate,
@@ -250,7 +250,7 @@ const EventDetailsSchedulingTab = ({
250250
<Formik<InitialValues>
251251
enableReinitialize
252252
initialValues={getInitialValues()}
253-
onSubmit={values => submitForm(values).then(() => {})}
253+
onSubmit={values => submitForm(values)}
254254
innerRef={formikRef}
255255
>
256256
{formik => (

src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowDetails.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ const OperationsPreview = ({
331331
workflowDone = !(workflowStatus === "SUCCEEDED" || workflowStatus === "FAILED" || workflowStatus === "STOPPED");
332332
}
333333

334-
const loadWorkflowOperations = async () => {
334+
const loadWorkflowOperations = () => {
335335
// Fetching workflow operations from server
336336
if (workflowId) {
337337
dispatch(fetchWorkflowOperations({ eventId, workflowId }));
@@ -340,7 +340,7 @@ const OperationsPreview = ({
340340

341341
useEffect(() => {
342342
// Fetch workflow operations initially
343-
loadWorkflowOperations().then();
343+
loadWorkflowOperations();
344344

345345
// Fetch workflow operations every 5 seconds
346346
const fetchWorkflowOperationsInterval = setInterval(loadWorkflowOperations, 5000);

src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperations.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ const EventDetailsWorkflowOperations = ({
3131
const workflowId = useAppSelector(state => getModalWorkflowId(state));
3232
const operations = useAppSelector(state => getWorkflowOperations(state));
3333

34-
const loadWorkflowOperations = async () => {
34+
const loadWorkflowOperations = () => {
3535
// Fetching workflow operations from server
3636
dispatch(fetchWorkflowOperations({ eventId, workflowId }));
3737
};
3838

3939
useEffect(() => {
4040
// Fetch workflow operations initially
41-
loadWorkflowOperations().then();
41+
loadWorkflowOperations();
4242

4343
// Fetch workflow operations every 5 seconds
4444
const fetchWorkflowOperationsInterval = setInterval(loadWorkflowOperations, 5000);

src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ const NewAccessPage = <T extends RequiredFormProps>({
184184
{/* Button for navigation to next page and previous page */}
185185
<WizardNavigationButtons
186186
formik={formik}
187-
nextPage={async () => {
188-
if (await dispatch(checkAcls(formik.values.policies))) {
187+
nextPage={() => {
188+
if (dispatch(checkAcls(formik.values.policies))) {
189189
nextPage(formik.values);
190190
}
191191
}}

src/components/events/partials/modals/EditScheduledEventsModal.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,15 @@ const EditScheduledEventsModal = ({
8989
errors.events = "Not all events editable!";
9090
}
9191
if (steps[page].name !== "general") {
92-
return checkSchedulingConflicts(
92+
const isConflict = checkSchedulingConflicts(
9393
values,
9494
setConflicts,
9595
dispatch,
96-
).then(result => {
97-
if (!result) {
98-
errors.editedEvents = "Scheduling conflicts exist!";
99-
}
100-
return errors;
101-
});
96+
);
97+
if (!isConflict) {
98+
errors.editedEvents = "Scheduling conflicts exist!";
99+
}
100+
return errors;
102101
} else {
103102
return errors;
104103
}

src/components/shared/RegistrationModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const RegistrationModalContent = () => {
7676
// eslint-disable-next-line react-hooks/exhaustive-deps
7777
}, []);
7878

79-
const onClickContinue = async () => {
79+
const onClickContinue = () => {
8080
// if state is deleteSubmit then delete infos about adaptor else show next state
8181
if (state === "deleteSubmit") {
8282
resetRegistrationData();

src/components/shared/Stats.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { loadEventsIntoTable } from "../../thunks/tableThunks";
1313
import { useAppDispatch, useAppSelector } from "../../store";
1414
import { fetchEvents } from "../../slices/eventSlice";
1515
import { ParseKeys } from "i18next";
16-
import { Tooltip } from "./Tooltip";
1716
import BaseButton from "./BaseButton";
1817

1918
/**

0 commit comments

Comments
 (0)