10 - max-lines-per-function
11 - max-nested-callbacks
16 The `max-statements` rule allows you to specify the maximum number of statements allowed in a function.
20 var bar = 1; // one statement
21 var baz = 2; // two statements
22 var qux = 3; // three statements
28 This rule enforces a maximum number of statements allowed in function blocks.
32 This rule has a number or object option:
34 * `"max"` (default `10`) enforces a maximum number of statements allows in function blocks
36 **Deprecated:** The object property `maximum` is deprecated; please use the object property `max` instead.
38 This rule has an object option:
40 * `"ignoreTopLevelFunctions": true` ignores top-level functions
44 Examples of **incorrect** code for this rule with the default `{ "max": 10 }` option:
49 /*eslint max-statements: ["error", 10]*/
64 var foo11 = 11; // Too many.
79 var foo11 = 11; // Too many.
85 Examples of **correct** code for this rule with the default `{ "max": 10 }` option:
90 /*eslint max-statements: ["error", 10]*/
106 // The number of statements in the inner function does not count toward the
107 // statement maximum.
126 // The number of statements in the inner function does not count toward the
127 // statement maximum.
136 Note that this rule does not apply to class static blocks, and that statements in class static blocks do not count as statements in the enclosing function.
138 Examples of **correct** code for this rule with `{ "max": 2 }` option:
143 /*eslint max-statements: ["error", 2]*/
164 ### ignoreTopLevelFunctions
166 Examples of additional **correct** code for this rule with the `{ "max": 10 }, { "ignoreTopLevelFunctions": true }` options:
171 /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/