diff options
Diffstat (limited to 'lib/src/lints/empty_let_in.rs')
-rw-r--r-- | lib/src/lints/empty_let_in.rs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/src/lints/empty_let_in.rs b/lib/src/lints/empty_let_in.rs index 4e0887d..b255c23 100644 --- a/lib/src/lints/empty_let_in.rs +++ b/lib/src/lints/empty_let_in.rs | |||
@@ -7,7 +7,24 @@ use rnix::{ | |||
7 | NodeOrToken, SyntaxElement, SyntaxKind, | 7 | NodeOrToken, SyntaxElement, SyntaxKind, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | /// empty let-in found | 10 | /// ## What it does |
11 | /// Checks for `let-in` expressions which create no new bindings. | ||
12 | /// | ||
13 | /// ## Why is this bad? | ||
14 | /// `let-in` expressions that create no new bindings are useless. | ||
15 | /// These are probably remnants from debugging or editing expressions. | ||
16 | /// | ||
17 | /// ## Example | ||
18 | /// | ||
19 | /// ``` | ||
20 | /// let in pkgs.statix | ||
21 | /// ``` | ||
22 | /// | ||
23 | /// Preserve only the body of the `let-in` expression: | ||
24 | /// | ||
25 | /// ``` | ||
26 | /// pkgs.statix | ||
27 | /// ``` | ||
11 | #[lint( | 28 | #[lint( |
12 | name = "empty let-in", | 29 | name = "empty let-in", |
13 | note = "Useless let-in expression", | 30 | note = "Useless let-in expression", |