fix: test board ts error#98
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
Pull request overview
This pull request adds a TypeScript ignore directive to suppress a type error when passing the board parameter to the pixel.Strip constructor in a hardware test file. The change allows the code to compile despite a type mismatch between the johnny-five Board object and what the node-pixel library expects.
Key Changes
- Adds
@ts-ignorecomment to suppress TypeScript error on theboardparameter
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const strip = new pixel.Strip({ | ||
| data: 12, // LED data pin | ||
| length: 24, // number of LEDs | ||
| // @ts-ignore board errpr |
There was a problem hiding this comment.
Spelling error in the comment: "errpr" should be "error".
| // @ts-ignore board errpr | |
| // @ts-ignore board error |
| // @ts-ignore board errpr | ||
| board: board, |
There was a problem hiding this comment.
Using @ts-ignore to suppress type errors is not recommended. Consider using @ts-expect-error instead, which will fail if the type error is fixed in the future (helping to clean up unnecessary suppressions). Alternatively, investigate and fix the underlying type issue properly by ensuring the board types are correctly defined or by using type assertions like board as any or more specific type casting.
| // @ts-ignore board errpr | |
| board: board, | |
| board: board as any, |
This pull request introduces a minor change to the
packages/hardware/test.tsfile. The change adds a TypeScript ignore directive to suppress a type error related to theboardparameter when initializing thepixel.Stripobject.