7

I am using jquery & jquery validate. I am also using typescript with the appropriate type files to go with it but when I do this line of code I get an error

  $('#form').validate().settings.ignore = [];

Error TS2322 (TS) Type 'undefined[]' is not assignable to type 'string'.

This peice of code seem to be valid and does work. Maybe it has changed to something else but I have not found anything else that would work.

1

1 Answer 1

12

You can disable typescript in line by using ts-expect-error comments:

  // @ts-expect-error
  $('#form').validate().settings.ignore = [];

You can read more about this here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.