Skip to content

Commit

Permalink
Add documentation for upcoming CommentDirective lint (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeux committed Feb 18, 2022
1 parent 731e197 commit 6aaaafc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/_pages/lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'?"
```
```

0 comments on commit 6aaaafc

Please sign in to comment.