Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Luau, consider using a variable for a type to be a usage of it #270

Closed
Dekkonot opened this issue Jun 30, 2021 · 0 comments · Fixed by #308
Closed

In Luau, consider using a variable for a type to be a usage of it #270

Dekkonot opened this issue Jun 30, 2021 · 0 comments · Fixed by #308
Labels
A-lints Area: Relating to a lint directly A-roblox Area: Roblox specific C-enhancement Category: Feature request or improvement

Comments

@Dekkonot
Copy link
Contributor

At the moment, this produces an unused variable lint:

local foo = require(script.bar)

local baz: foo.quux

Ideally, it would consider the use of foo in the type annotation to be a valid use of it.

I'm doing this because a project I'm using has very large type definitions, and it's horrible to have them in the same file as the bulk of my code, so I split it. This ends up leaving me with a module that's only used for type definitions though. It makes me sad to have to manually suppress this lint.

@Kampfkarren Kampfkarren added A-roblox Area: Roblox specific C-enhancement Category: Feature request or improvement A-lints Area: Relating to a lint directly labels Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Relating to a lint directly A-roblox Area: Roblox specific C-enhancement Category: Feature request or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants