luacheck
luacheck copied to clipboard
Add support for custom operators (like those in the Playdate SDK)?
Hey there. The Playdate SDK uses Lua and adds a handful of additional assignment operators, like +=
and -=
that aren't present in the normal Lua language.
I'd love to be able to run luacheck
on my Playdate lua code. When I do that now with one of these custom operators (In the example below, +=
), luacheck
(rightly) gives me an error:
Can you please add a way to specify that these operators are not actually errors, maybe in the .luacheckrc
file? Or maybe even just a way to specify that this error should be ignored when encountering these operators?
Thanks!
Ignoring this syntax error would probably open up a whole kettle of fish where random other mistakes would get through. But exposing the list of valid operators is such a way that it would be possible to add an operator via the RC file might be feasible. I only skimmed the relevant code but it doesn't look impossible to me.
I don't have the time to hack on it right now but I'd be willing to review and facilitate a PR if anybody else wants to contribute this.