seaofvoices / darklua

A command line tool that transforms Lua code
https://darklua.com/
MIT License
71 stars 9 forks source link

`remove_unused_variable` does not work #182

Closed jeparlefrancais closed 3 months ago

jeparlefrancais commented 5 months ago

The rule does not work at all with this input for example:

local Array = require("./Array")
local Map = require("./Map")
local Object = require("./Object")
local Set = require("./Set")
local WeakMap = require("./WeakMap")
local inspect = require("./inspect")

local types = require("@pkg/@jsdotlua/es7-types")

export type Array<T> = types.Array<T>
export type Map<T, V> = types.Map<T, V>
export type Object = types.Object
export type Set<T> = types.Set<T>
export type WeakMap<T, V> = types.WeakMap<T, V>

return {
    Array = Array,
    Object = Object,
    Map = Map.Map,
    coerceToMap = Map.coerceToMap,
    coerceToTable = Map.coerceToTable,
    Set = Set,
    WeakMap = WeakMap,
    inspect = inspect,
}