goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.82k stars 109 forks source link

Incorrect optional param annotation for dasboard.button function #126

Closed ehllie closed 2 years ago

ehllie commented 2 years ago

https://github.com/goolord/alpha-nvim/blob/79187fdf8f2a08a7174f237423198f6e75ae213a/lua/alpha/themes/dashboard.lua#L42-L46 In the module alpha.themes.dashboard, the function button has EmmyLua annotations written for it, however it improperly signals that the keybind and keybind_opts are optional. The official spec requires that to be indicated with a ? after the param type, currently it's just adding a comment that says optional to the parameters. This results in the linter raising a warning: Lua Diagnostics.: This function requires 4 argument(s) but instead it is receiving 3. on a line with

require("alpha.themes.dashboard").button("f", " " .. " Find file", ":Telescope find_files <CR>")