Sleitnick / Knit

Lightweight game framework for Roblox
https://sleitnick.github.io/Knit/
MIT License
567 stars 97 forks source link

Luau typing is not accurate #225

Closed jackprogramsjp closed 4 months ago

jackprogramsjp commented 1 year ago

image

Here, in the code above, there is a type error because it seems that KnitServer can't be converted to KnitClient, assuming that the module init.lua can only return one type?

So when I require Knit, it always returns the KnitServer type, causing Type issues within Studio.

So to prevent these type issues, I have to go into Packages, and require the KnitClient specifically to get the intellisense typing desired.

image

This uses Luau-LSP (which is pretty much the same as the Roblox Studio's Language Server).

Are you able to prevent this from happening?

Or, if you're making a Wally package, make it so I can directly require the KnitClient/KnitServer without having to go to the _index area?

Sleitnick commented 4 months ago

248