Add documentation for upcoming CommentDirective lint (#361)

This commit is contained in:
Arseny Kapoulkine 2022-02-17 16:58:43 -08:00 committed by GitHub
parent 731e197757
commit 6aaaafcc8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -317,3 +317,13 @@ The code above can be rewritten as follows to avoid the warning and the associat
```lua
local x = if flag then false else true
```
## CommentDirective (26)
Luau uses comments that start from `!` to control certain aspects of analysis, for example setting type checking mode via `--!strict` or disabling individual lints with `--!nolint`. Unknown directives are ignored, for example `--!nostrict` doesn't have any effect on the type checking process as the correct spelling is `--!nonstrict`. This warning flags comment directives that are ignored during processing:
```lua
--!nostrict
-- Unknown comment directive 'nostrict'; did you mean 'nonstrict'?"
```
```