newline-before-continue
- Group
- Style
- Path
lint/style/newline-before-continue- Default
- Off, opt in
- Origin
- Falcon
- Rule
- 276 of 512
Requires a blank line before a continue that follows another statement.
Checks labeled and unlabeled continues in blocks. First statements, unbraced continues, and switch-case lists are exempt. Blank lines above comments count.
Invalid
void loops(bool condition) {
while (condition) {
print('before');
continue;
}
outer: for (var i = 0; i < 3; i++) {
while (condition) {
print('nested');
continue outer;
}
}
}
void commented(bool condition) {
while (condition) {
print('before');
// No separating blank line.
continue;
}
} print('before'); continue; print('nested'); continue outer; // No separating blank line. continue;Valid
void loops(bool condition) {
while (condition) {
continue;
}
while (condition) {
print('before');
continue;
}
outer: for (var i = 0; i < 3; i++) {
while (condition) {
continue outer;
}
}
while (condition) {
if (condition) continue;
}
}
void cases(int value) {
while (true) {
switch (value) {
case 0:
print(value);
continue next;
next:
default:
return;
}
}
}
void commented(bool condition) {
while (condition) {
print('before');
// Start another iteration.
continue;
}
}Configure newline-before-continue
Set its severity in falcon.json. See the configuration guide.
{
"linter": {
"rules": {
"style": {
"newline-before-continue": "error"
}
}
}
}Or silence one occurrence with a suppression comment; the reason is required.
// falcon-ignore lint/style/newline-before-continue: <reason>More style rules
- newline-before-method
Requires a blank line before method declarations following another member.
- newline-before-return
newline-before-returnFlags
returnstatements that are not preceded by a blank line. - newline-before-throw
Requires a blank line before a throw that follows another statement.
- no-default-cases
no_default_casesFlags
default:in switch statements over enums and enum-like classes. - no-leading-underscores-for-library-prefixes
no_leading_underscores_for_library_prefixesrecommendedFlags import prefixes that begin with an underscore.
- no-leading-underscores-for-local-identifiers
no_leading_underscores_for_local_identifiersrecommendedFlags local variables and parameters whose names begin with an underscore.
- no-literal-bool-comparisons
no_literal_bool_comparisonsFlags boolean literals compared or combined with a non-nullable
bool. - no-magic-number
no-magic-numberFlags unnamed numeric literals (magic numbers) used inline in expressions.