goolord / alpha-nvim

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

Fix to type annotations #126 #127

Closed ehllie closed 2 years ago

ehllie commented 2 years ago

Resolving the issue #126 as well as updating other incorrect type annotations

ehllie commented 2 years ago

The spec actually specifies that the ? should be written after the argument name rather than type, or union the type with |nil, however adding a ? to the param type seems to have the same effect as declaring it a |nil union, and that's how the return type is declared in the provided example.

Appending a question mark (after the first word) marks a param optional/nilable. Another option is to instead use |nil as a second type.

goolord commented 2 years ago

thx