feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass

This commit is contained in:
Michael Zetterberg
2025-02-07 06:51:36 +01:00
parent e22fc1f3c8
commit 440e1f92df
393 changed files with 4839 additions and 1554 deletions

View File

@@ -1,3 +1,5 @@
/* eslint-disable formatjs/no-literal-string-in-jsx */
import { describe, expect, test } from "@jest/globals" // importing because of type conflict with globals from Cypress
import { render, screen } from "@testing-library/react"
import { type UserEvent, userEvent } from "@testing-library/user-event"

View File

@@ -61,9 +61,15 @@ export default function DateSelect({ name, registerOptions = {} }: DateProps) {
label: `${day}`,
}))
const dayLabel = intl.formatMessage({ id: "Day" })
const monthLabel = intl.formatMessage({ id: "Month" })
const yearLabel = intl.formatMessage({ id: "Year" })
const dayLabel = intl.formatMessage({
defaultMessage: "Day",
})
const monthLabel = intl.formatMessage({
defaultMessage: "Month",
})
const yearLabel = intl.formatMessage({
defaultMessage: "Year",
})
useEffect(() => {
if (formState.isSubmitting) return
@@ -120,7 +126,9 @@ export default function DateSelect({ name, registerOptions = {} }: DateProps) {
return (
<DatePicker
aria-label={intl.formatMessage({ id: "Select date of birth" })}
aria-label={intl.formatMessage({
defaultMessage: "Select date of birth",
})}
isRequired={!!registerOptions.required}
isInvalid={!formState.isValid}
name={name}