Skip to content

Commit 32cad26

Browse files
committed
eslint rules set 1
1 parent 51c3619 commit 32cad26

24 files changed

Lines changed: 68 additions & 46 deletions

File tree

eslint.config.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,15 @@ export default tseslint.config(
6161
'@typescript-eslint/no-unsafe-call': 'off',
6262
'@typescript-eslint/no-unsafe-return': 'off',
6363
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
64-
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
65-
'@typescript-eslint/no-redundant-type-constituents': 'off',
64+
},
65+
},
66+
{
67+
// Test files: `async` test callbacks and `act(async () => {})` wrappers are
68+
// idiomatic even when they contain no `await` (async `act` flushes the
69+
// microtask queue). Relaxing require-await here avoids churn in test infra.
70+
files: ['**/*.spec.{ts,tsx}', '**/*.test.{ts,tsx}'],
71+
rules: {
6672
'@typescript-eslint/require-await': 'off',
67-
'@typescript-eslint/no-misused-promises': 'off',
6873
},
6974
},
7075
prettierRecommended,

src/app/[locale]/account/notifications/AccountNotifications.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,7 @@ export default function AccountNotifications(): React.ReactElement {
315315
<Select
316316
value={defaultFrequency}
317317
onChange={(e) => {
318-
setDefaultFrequency(
319-
e.target.value as NotificationSettings['frequency'],
320-
);
318+
setDefaultFrequency(e.target.value);
321319
}}
322320
size='small'
323321
>

src/app/[locale]/complete-registration/CompleteRegistration.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default function CompleteRegistration(): React.ReactElement {
8686
validationSchema: CompleteRegistrationSchema,
8787
validateOnChange: isSubmitted,
8888
validateOnBlur: true,
89-
onSubmit: async (values) => {
89+
onSubmit: (values) => {
9090
if (user != null) {
9191
dispatch(
9292
refreshUserInformation({

src/app/[locale]/contribute/FeedSubmission/Form/FirstStep.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ export default function FormFirstStep({
107107

108108
return (
109109
<>
110-
<form onSubmit={handleSubmit(onSubmit)}>
110+
<form
111+
onSubmit={(e) => {
112+
void handleSubmit(onSubmit)(e);
113+
}}
114+
>
111115
<Grid container direction={'column'} rowSpacing={2}>
112116
<Grid>
113117
<FormControl

src/app/[locale]/contribute/FeedSubmission/Form/FourthStep.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ export default function FormFourthStep({
6767

6868
return (
6969
<>
70-
<form onSubmit={handleSubmit(onSubmit)}>
70+
<form
71+
onSubmit={(e) => {
72+
void handleSubmit(onSubmit)(e);
73+
}}
74+
>
7175
<Grid container direction={'column'} rowSpacing={2}>
7276
<Grid>
7377
<FormControl component='fieldset' fullWidth>

src/app/[locale]/contribute/FeedSubmission/Form/SecondStep.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ export default function FormSecondStep({
5959
return (
6060
<>
6161
<Typography gutterBottom>{t('gtfsScheduleFeed')}</Typography>
62-
<form onSubmit={handleSubmit(onSubmit)}>
62+
<form
63+
onSubmit={(e) => {
64+
void handleSubmit(onSubmit)(e);
65+
}}
66+
>
6367
<Grid container direction={'column'} rowSpacing={2}>
6468
<Grid>
6569
<FormControl

src/app/[locale]/contribute/FeedSubmission/Form/SecondStepRealtime.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ export default function FormSecondStepRT({
111111
>
112112
{t('gtfsRealtimeFeed')}
113113
</Typography>
114-
<form onSubmit={handleSubmit(onSubmit)}>
114+
<form
115+
onSubmit={(e) => {
116+
void handleSubmit(onSubmit)(e);
117+
}}
118+
>
115119
<Grid container direction={'column'} rowSpacing={2}>
116120
<Grid>
117121
<FormControl

src/app/[locale]/contribute/FeedSubmission/Form/ThirdStep.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ export default function FormThirdStep({
7474

7575
return (
7676
<>
77-
<form onSubmit={handleSubmit(onSubmit)}>
77+
<form
78+
onSubmit={(e) => {
79+
void handleSubmit(onSubmit)(e);
80+
}}
81+
>
7882
<Grid container direction={'column'} rowSpacing={2}>
7983
{/* Show required emptyLicenseUsage if official producer and no license provided */}
8084
{isOfficialProducer && noLicenseProvided && (

src/app/[locale]/feeds/[feedDataType]/[feedId]/static/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ interface Props {
2424
* from the clean URLs like /feeds/gtfs/mdb-123.
2525
* TODO: Now that legacy catch-all route is removed, change this to a private route `_static` and update proxy and links accordingly.
2626
*/
27-
export default async function StaticFeedLayout({
27+
export default function StaticFeedLayout({
2828
children,
2929
params,
30-
}: Props): Promise<React.ReactElement> {
30+
}: Props): React.ReactElement {
3131
return <>{children}</>;
3232
}

src/app/[locale]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default async function LocaleLayout({
8484
}
8585

8686
// At this point, locale is guaranteed to be a valid Locale type
87-
const validLocale = locale as Locale;
87+
const validLocale = locale;
8888

8989
// Enable static rendering for this locale
9090
setRequestLocale(validLocale);

0 commit comments

Comments
 (0)