Home > Software engineering >  tslint:disable-next-line won't work for jsx prop error
tslint:disable-next-line won't work for jsx prop error

Time:06-01

I'm using react-select, I want to pass a prop that doesn't exist, but the lib is throwing an error, I try to skip it by putting disable-next-line, it won't work. But the code is doing fine, I believe it's a false positive, any clue why how to solve this issue?

<Select
  /* tslint:disable-next-line */
  handleClick={handleClick}
/>

CodePudding user response:

Can you use // tslint:disable-next-line instead of /* tslint:disable-next-line */

refer TSLint rule flags

CodePudding user response:

This error is related to typescript and not ts-lint You can suppress this error by using @ts-ignore

<Select
  // @ts-ignore
  handleClick={handleClick}
/>
  • Related