Skip to content

hook.Add should not warn upon returning value in hook with no documented return value #86

Description

@luttje

This definition:

---@overload fun(eventName: "PlayerLoadout", identifier: any, func: fun(ply: Player))

Results in this warning:

Image

Despite the wiki not describing a return value for PlayerLoadout and similar hooks, since hook.Run will cease calling further hooks if any not-nil value is returned the code is valid and should not warn.

Perhaps if the hook has no return value on the wiki we should have it be any by default.

And untested, but there is likely a warning when the inverse happens, so in that case I guess we should have all returns in hooks be nillable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions