From 6aaaafcc8d3e515514ff1a72621da500f0c83404 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 17 Feb 2022 16:58:43 -0800 Subject: [PATCH] Add documentation for upcoming CommentDirective lint (#361) --- docs/_pages/lint.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/_pages/lint.md b/docs/_pages/lint.md index de4d247ee..340d35a26 100644 --- a/docs/_pages/lint.md +++ b/docs/_pages/lint.md @@ -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'?" +``` +```