-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Tons of linting errors in tsx files from pcui components #330
Comments
This is an issue with PCUI. Moving this issue there... |
Thanks |
I was about to open a similar issue but I found this one. I haven't used the PCIU since my first attempt (in 2021). I had some issues with importing classes at that time, but in v4.x.x it improved. Yet I faced linting errors when tried the library this time in my React TS project. I was checking the package files and I found that the exports for the react don't specify the path to the d.ts file. if you go to
If you change that to this, it should fix many issues with TS linter
@Weichengfang , I wonder if that also can help you to get rid of the lining errors. |
Hi @HusakYurii, Thanks so much for this! Just curious, why not submit a PR with the fix yourself? |
Hey @slimbuck |
@HusakYurii The |
@Weichengfang Did I move this issue here from the 'model-viewer` repo? If so, I believe I fixed this with this PR: playcanvas/model-viewer#274 @HusakYurii Can you provide me with a simple way to reproduce the problem you're experiencing? The |
@willeastcott my apologies for being very very slow.... The issue I mentioned, probably, relates to the one you have here playcanvas/model-viewer#274
To fix this, I did this
to
That will explicitly point to the correct d.ts file to make vs code happy. That will also enable TS to autocomplete things in the code. I hope that helps |
Hi @HusakYurii. Thanks very much for the instructions on how to fix this. I have applied this patch and just released PCUI 4.2.0. Please test it and let me know if you have any problems. 🙏 |
Thank you for fixing that! I don't think I will use the library any soon but I hope that helps others! |
The VS Code is reporting tons of source problems, though the code builds fine. see the example below:
JSX element class does not support attributes because it does not have a 'props' property.
'Container' cannot be used as a JSX component.
Its type 'typeof Container' is not a valid JSX element type.
Types of construct signatures are incompatible.
Type 'new (args?: Readonly) => Container' is not assignable to type 'new (props: any, deprecatedLegacyContext?: any) => Component<any, any, any>'.
Type 'Container' is missing the following properties from type 'Component<any, any, any>': context, setState, forceUpdate, render, and 3 more.
To reproduce it, pull latest main branch, and open the root folder in VS Code, next open any tsx files in VS Code, It will report a lot of problems similar to above.
The text was updated successfully, but these errors were encountered: