You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
+6-55Lines changed: 6 additions & 55 deletions
Original file line number
Diff line number
Diff line change
@@ -16,80 +16,31 @@ use std::num::NonZeroU8;
16
16
declare_lint_rule!{
17
17
/// Restrict the number of lines of code in a function.
18
18
///
19
-
/// This rule checks the number of lines in a function body and reports a diagnostic if it exceeds a specified limit.
19
+
/// This rule checks the number of lines in a function body and reports a diagnostic if it exceeds a specified limit. Remember that this rule only counts the lines of code in the function body, not the entire function declaration.
20
20
/// Some people consider large functions a code smell. Large functions tend to do a lot of things and can make it hard following what’s going on. Many coding style guides dictate a limit of the number of lines that a function can comprise of. This rule can help enforce that style.
21
21
///
22
22
/// ## Examples
23
23
///
24
-
/// When maximum number of lines is set to `2` with the following option, the following code will be considered invalid:
25
-
/// ```json,options
26
-
/// {
27
-
/// "options": {
28
-
/// "maxLines": 2
29
-
/// }
30
-
/// }
31
-
/// ```
32
-
///
33
24
/// ### Invalid
34
25
///
35
-
/// ```js,expect_diagnostic,use_options
36
-
/// function foo () {
37
-
/// const x = 0;
38
-
/// const y = 1;
39
-
/// const z = 2;
40
-
/// };
41
-
/// ```
26
+
/// The following example will show diagnostic when you set the maxLines limit to 3, however the default value is 50.
0 commit comments