mpeterv / luacheck

A tool for linting and static analysis of Lua code.
MIT License
1.92k stars 322 forks source link

Use TypedLua definition files #137

Closed Zash closed 6 years ago

Zash commented 7 years ago

This may be out of scope and/or overlap with #129 but I would very much like to have something that understood TypedLua definition files and pointed out violations.

mpeterv commented 7 years ago

Do you mean that luacheck should find type errors according to these definition files? Isn't is the role of TypedLua itself to do that? If you mean that luacheck should simply allow working with globals listed in the definition file it could be useful to avoid duplication of custom globals in TypedLua definition and .luacheckrc.

Zash commented 7 years ago

I'm basically looking for a way to get some of the benefits of static typing without the need to rewrite a large codebase in a statically typed language. As I said, it might be out of scope for luacheck.

mpeterv commented 6 years ago

I like the idea of some less strict type checking that prioritizes avoiding false positives, using type annotations more as hints rather than assertions. However, it's indeed out with of scope for luacheck IMO. Even if at some point luacheck gets this type of type checking then it'll probably have its own definition format.