Open RodrigoDornelles opened 1 day ago
You can use a .luaurc file to specify globals. Does that fit your usecase? https://rfcs.luau-lang.org/config-luaurc
You can use a .luaurc file to specify globals. Does that fit your usecase? https://rfcs.luau-lang.org/config-luaurc
@JohnnyMorganz
The issue of globals makes my case solved! but I would like to do this through comments because it would be part of the documentation.
--! @li
--! @lint global native_draw_line
--! [see](https://rodrigodornelles.github.io/core-native-sdl/a00020.html#gab7df3f76d238de241fe713fe91724d40)
std.draw.line = native_draw_line
but other cases, such as I would like to ignore the lint for just one line, as depending on the platform my buildsystem remove the line.
--! @lint ignore-next TypeError UnknownRequire
local math = require('math')
I would also like to say to linter that some globals are being used.
--! @lint ignore-next FunctionUnused
function native_callback_keyboard(key, value)
std.key.press[key] = value
end
I'm not good with names, so it's just a functionality suggestion, many linters work like this, it's interesting to work with local configurations in order not to leave the entire project with weaker checking.
The issue is that I have globals externally, and I wanted to somehow notify the linter that they exist.
If there is already support for this, it could be a documentation issue, Otherwise, I think it would be interesting to be able to disable some rules for specific or global lines. instead of the entire linter disabled.
I know that there is
--!nolint NAME
at the beginning of the file, but it is very generic, unknown globals areTypeError
but typing errors are also, in addition to the fact that I want to explicitly say variable or line to ignore some check.