Skip to content

lots of linter fixes#348

Open
oliviaBahr wants to merge 1 commit intoBalatro-Multiplayer:mainfrom
oliviaBahr:linter
Open

lots of linter fixes#348
oliviaBahr wants to merge 1 commit intoBalatro-Multiplayer:mainfrom
oliviaBahr:linter

Conversation

@oliviaBahr
Copy link
Contributor

Make the linter happy :)

@Brawmario
Copy link
Member

Brawmario commented Jan 29, 2026

My two cents:

  • These new global_table = global_table or nil lines makes no sense to me. nil is already the default value that a Lua symbol will evaluate to if it's not defined, so adding these lines are a no-op as far as the semantics of the language are concerned. Worst case scenario these symbols are actually holding a boolean false value instead, in which case you're just "deleting" that value.
  • Silently returning from a function just because a table we expected to be valid is nil can be problematic. Sure, we avoid a crash by avoiding to deference a nil symbol, but this can cause bugs that will be much harder to debug, since this can cause the program to malfunction much later, and then it will be difficult to link that malfunction to the root cause. Sometimes it's for the best that the program crashes spectacularly when it should, since at least the source of the bug becomes obvious. At the very least we should definitely log any table that is nil when it should exist.

Overall, we have to ask ourselves "WHY is the linter unhappy" and not just attempt to appease it at any cost.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants