illuaminate
illuaminate copied to clipboard
Warn on accessing undefined globals/names
Now that #6 is merged, we have a decent way of determining what globals and modules are available in the current context. This should allow us to monitor global and require
usages, and ensure they are consistent with what one might expect.
I'm probably envisaging two warnings here, though they can probably be done with the same linter:
- Accessing unknown global: just check that we have a global (either documented within this unit or external) with this name.
- Compatible usage: if we have such a global, ensure that our usage is compatible. For now, this can probably boil down to:
- If this is a table, ensure we're using it as so and the key exists (if it's a string literal).
- If this is a function, ensure we're passing in sufficient arguments.
However, it's not clear how to handle external names. We can definitely bake the standard library into illuaminate, but it might be nice to find a better way.