Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { useIntl } from 'react-intl'
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { passwordValidators } from '@scandic-hotels/common/utils/zod/passwordValidator'
|
||||
import type { PasswordValidatorKey } from '@scandic-hotels/common/utils/zod/newPassword'
|
||||
import { MaterialIcon } from '../Icons/MaterialIcon'
|
||||
import { Typography } from '../Typography'
|
||||
import { passwordValidators } from "@scandic-hotels/common/utils/zod/passwordValidator"
|
||||
import type { PasswordValidatorKey } from "@scandic-hotels/common/utils/zod/newPassword"
|
||||
import { MaterialIcon } from "../Icons/MaterialIcon"
|
||||
import { Typography } from "../Typography"
|
||||
|
||||
import styles from './passwordInput.module.css'
|
||||
import styles from "./passwordInput.module.css"
|
||||
|
||||
export function NewPasswordValidation({
|
||||
value,
|
||||
@@ -22,53 +22,53 @@ export function NewPasswordValidation({
|
||||
|
||||
function getErrorMessage(key: PasswordValidatorKey) {
|
||||
switch (key) {
|
||||
case 'length':
|
||||
case "length":
|
||||
return intl.formatMessage(
|
||||
{
|
||||
id: 'passwordInput.lengthRequirement',
|
||||
defaultMessage: '{min} to {max} characters',
|
||||
id: "passwordInput.lengthRequirement",
|
||||
defaultMessage: "{min} to {max} characters",
|
||||
},
|
||||
{
|
||||
min: 10,
|
||||
max: 40,
|
||||
}
|
||||
)
|
||||
case 'hasUppercase':
|
||||
case "hasUppercase":
|
||||
return intl.formatMessage(
|
||||
{
|
||||
id: 'passwordInput.uppercaseRequirement',
|
||||
defaultMessage: '{count} uppercase letter',
|
||||
id: "passwordInput.uppercaseRequirement",
|
||||
defaultMessage: "{count} uppercase letter",
|
||||
},
|
||||
{ count: 1 }
|
||||
)
|
||||
case 'hasLowercase':
|
||||
case "hasLowercase":
|
||||
return intl.formatMessage(
|
||||
{
|
||||
id: 'passwordInput.lowercaseRequirement',
|
||||
defaultMessage: '{count} lowercase letter',
|
||||
id: "passwordInput.lowercaseRequirement",
|
||||
defaultMessage: "{count} lowercase letter",
|
||||
},
|
||||
{ count: 1 }
|
||||
)
|
||||
case 'hasNumber':
|
||||
case "hasNumber":
|
||||
return intl.formatMessage(
|
||||
{
|
||||
id: 'passwordInput.numberRequirement',
|
||||
defaultMessage: '{count} number',
|
||||
id: "passwordInput.numberRequirement",
|
||||
defaultMessage: "{count} number",
|
||||
},
|
||||
{ count: 1 }
|
||||
)
|
||||
case 'hasSpecialChar':
|
||||
case "hasSpecialChar":
|
||||
return intl.formatMessage(
|
||||
{
|
||||
id: 'passwordInput.specialCharacterRequirement',
|
||||
defaultMessage: '{count} special character',
|
||||
id: "passwordInput.specialCharacterRequirement",
|
||||
defaultMessage: "{count} special character",
|
||||
},
|
||||
{ count: 1 }
|
||||
)
|
||||
case 'allowedCharacters':
|
||||
case "allowedCharacters":
|
||||
return intl.formatMessage({
|
||||
id: 'passwordInput.allowedCharactersRequirement',
|
||||
defaultMessage: 'Only allowed characters',
|
||||
id: "passwordInput.allowedCharactersRequirement",
|
||||
defaultMessage: "Only allowed characters",
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -107,8 +107,8 @@ function Icon({ errorMessage, errors }: IconProps) {
|
||||
size={20}
|
||||
role="img"
|
||||
aria-label={intl.formatMessage({
|
||||
id: 'common.error',
|
||||
defaultMessage: 'Error',
|
||||
id: "common.error",
|
||||
defaultMessage: "Error",
|
||||
})}
|
||||
/>
|
||||
) : (
|
||||
@@ -118,8 +118,8 @@ function Icon({ errorMessage, errors }: IconProps) {
|
||||
size={20}
|
||||
role="img"
|
||||
aria-label={intl.formatMessage({
|
||||
id: 'common.success',
|
||||
defaultMessage: 'Success',
|
||||
id: "common.success",
|
||||
defaultMessage: "Success",
|
||||
})}
|
||||
/>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user