Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjeevan committed Sep 26, 2024
1 parent f414012 commit 42a06f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/Form/MultiSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ErrorMessage, useField } from 'formik'
import Select, { ActionMeta, MultiValue } from 'react-select'
import Select, { MultiValue } from 'react-select'

type Option = {
value: string | number
Expand All @@ -14,7 +14,7 @@ interface Props {
const MultiSelectField: React.FC<Props> = ({ name, options }) => {
const [field, , helpers] = useField(name)

const handleChange = (newValue: MultiValue<Option>, actionMeta: ActionMeta<Option>) => {
const handleChange = (newValue: MultiValue<Option>) => {
const values = newValue.map((it) => it.value)
helpers.setValue(values)
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/Settings/components/Field/FieldForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ErrorMessage, FieldArray, Form, Formik, FormikHelpers, getIn, useFormikContext } from 'formik'
import { FieldArray, Form, Formik, FormikHelpers, getIn, useFormikContext } from 'formik'
import * as Yup from 'yup'

import spinner from '@/assets/icons/spinner.svg'
Expand All @@ -23,7 +23,7 @@ interface Props {
onSubmit: (values: FormValues, helpers: FormikHelpers<FormValues>) => void | Promise<void>
}

Yup.addMethod(Yup.array, 'unique', function (message, _mapper = (a: unknown) => a) {
Yup.addMethod(Yup.array, 'unique', function (message) {
return this.test('unique', message, function <T>(this: Yup.TestContext, list: Array<T> | undefined) {
const seen = new Set()
if (!list) {
Expand Down Expand Up @@ -138,7 +138,7 @@ const FieldForm: React.FC<Props> = ({ onSubmit, field }) => {
name="availableOptions"
render={(helpers) => <OptionsArrayField {...helpers} placeholder="Option name" />}
/>
<ArrayErrorMessage name="availableOptions" className="error-help" />
<ArrayErrorMessage name="availableOptions" />
</div>
) : null}
<div>
Expand Down

0 comments on commit 42a06f1

Please sign in to comment.