Kampfkarren / selene

A blazing-fast modern Lua linter written in Rust

Home Page:https://kampfkarren.github.io/selene/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: `unused_variable` throws when import is only used for Luau type

TreehouseFalcon opened this issue · comments

Selene currently throws an unused_variable lint when an imported module is only used for its exported Luau types. Specifically, this only seems to occur when the usage is wrapped in a typeof() call.

Reproduction:
package.lua

return {
	Bar = "hello",
}

impl.lua

local Foo = require("package.lua")
type Bar = typeof(Foo.Bar)

The Selene VSCode extension immediately starts linting when these two files are set up.

I believe this is related to #423.

Just realized with updated context that this is a duplicate of #337