Update lint.md

Update FunctionUnused and ImportUnused following internal changes that make it possible to suppress the warning using _
This commit is contained in:
Arseny Kapoulkine 2021-06-02 11:58:32 -07:00 committed by GitHub
parent 2a29ba1538
commit fad40bfd86
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,7 +100,7 @@ print(x, x)
While unused local variables could be useful for debugging, unused functions usually contain dead code that was meant to be removed. Unused functions clutter code, can be a result of typos similar to local variables, and can mislead the reader into thinking that some functionality is supported. While unused local variables could be useful for debugging, unused functions usually contain dead code that was meant to be removed. Unused functions clutter code, can be a result of typos similar to local variables, and can mislead the reader into thinking that some functionality is supported.
```lua ```lua
-- Function 'bar' is never used -- Function 'bar' is never used; prefix with '_' to silence
local function bar() local function bar()
end end
@ -115,7 +115,7 @@ return foo()
In Luau, there's no first-class module system that's part of the syntax, but `require` function acts as an import statement. When a local is initialized with a `require` result, and the local is unused, this is classified as "unused import". Removing unused imports improves code quality because it makes it obvious what the dependencies of the code are: In Luau, there's no first-class module system that's part of the syntax, but `require` function acts as an import statement. When a local is initialized with a `require` result, and the local is unused, this is classified as "unused import". Removing unused imports improves code quality because it makes it obvious what the dependencies of the code are:
```lua ```lua
-- Import 'Roact' is never used -- Import 'Roact' is never used; prefix with '_' to silence
local Roact = require(game.Packages.Roact) local Roact = require(game.Packages.Roact)
``` ```