From 15753833b05ba1a0e6584eeb40719d207f1455c8 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Mon, 12 Jul 2021 09:20:59 -0700 Subject: [PATCH] Update lint.md Add documentation for the upcoming DuplicateCondition lint --- docs/_pages/lint.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/_pages/lint.md b/docs/_pages/lint.md index ba9a6977..ad293dd2 100644 --- a/docs/_pages/lint.md +++ b/docs/_pages/lint.md @@ -284,3 +284,10 @@ table.insert(t, 0, 42) -- table.insert uses index 0 but arrays are 1-based; did table.insert(t, #t+1, 42) -- table.insert will append the value to the table; consider removing the second argument for efficiency ``` +## DuplicateCondition (24) + +When checking multiple conditions via `and/or` or `if/elseif`, a copy & paste error may result in checking the same condition redundantly. This almost always indicates a bug, so a warning is emitted when use of a duplicate condition is detected. + +```lua +assert(self._adorns[normID1] and self._adorns[normID1]) -- Condition has already been checked on column 8 +```