Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check fails in function chaining #54

Closed
ryancrunchi opened this issue Aug 3, 2021 · 1 comment
Closed

Check fails in function chaining #54

ryancrunchi opened this issue Aug 3, 2021 · 1 comment

Comments

@ryancrunchi
Copy link

ryancrunchi commented Aug 3, 2021

export const validationSchema = Yup.object({
  email: Yup.string()
    .email('1')
    .required('2'),
})

Error raised for 2, but not 1

await Auth.forgotPassword(email)
  .then(() => {
    showSuccessNotification({ title: '1' })
  })
  .catch((error) => {
    showErrorNotification({
      title: `2`,
    })
  })

Error raised for 2, not 1

export const validationSchema = Yup.object({
  code: Yup.string().required('1'),
  password: Yup.string()
    .required('2')
    .min(8, '3')
    .matches(/[0-9]/, '4')
    .matches(/[A-Z]/, '5')
    .matches(/[!@#$%^&*(),.?":{}|<>]/, '6'),
  confirmPassword: Yup.string()
    .oneOf([Yup.ref('password')], '7')
    .required('8'),
})

Errors raised for 1, 6, 8 not for others

Configuration is :

    "i18next/no-literal-string": ["error",
      {
        "ignoreCallee": [
          "console.log", "console.warn", "console.error",
          "document.querySelector", "gtag", "useField"
        ],
        "validateTemplate": true,
        "ignoreAttribute": [
          "autoComplete",
          "data-testid",
          "testId",
          "containerClasses",
          "contentClasses",
          "buttonWrapperClasses",
          "buttonClasses",
          "declineButtonClasses",
          "role", "href", "target",
          "inputVariant", "dataKey"
        ]
      }
    ]

Edit : after thinking, it seems only the last string is checked in a function chaining

@ryancrunchi ryancrunchi changed the title Check fails on some cases Check fails in function chaining Aug 3, 2021
@edvardchen
Copy link
Owner

@ryancrunchi try the prerelease version v6.0.0-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants