diff --git a/src/rules/preferWhileRule.ts b/src/rules/preferWhileRule.ts index 370ff9a5ef8..e14a79a78fc 100644 --- a/src/rules/preferWhileRule.ts +++ b/src/rules/preferWhileRule.ts @@ -23,7 +23,7 @@ export class Rule extends Lint.Rules.AbstractRule { /* tslint:disable:object-literal-sort-keys */ public static metadata: Lint.IRuleMetadata = { ruleName: "prefer-while", - description: "Prefer while loops when instead of a for loop without an initializer and incrementor.", + description: "Prefer `while` loops instead of `for` loops without an initializer and incrementor.", rationale: "Simplifies the readability of the loop statement, while maintaining the same functionality.", optionsDescription: "Not configurable.", options: null, @@ -34,7 +34,7 @@ export class Rule extends Lint.Rules.AbstractRule { }; /* tslint:enable:object-literal-sort-keys */ - public static FAILURE_STRING = "Expected a 'while' loop instead of a 'for' loop without an initializer and incrementor"; + public static FAILURE_STRING = "Prefer `while` loops instead of `for` loops without an initializer and incrementor."; public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { const failures: Lint.RuleFailure[] = []; diff --git a/test/rules/prefer-while/bad-no-condition/test.ts.lint b/test/rules/prefer-while/bad-no-condition/test.ts.lint index 7fe62d6f54a..003ef909505 100644 --- a/test/rules/prefer-while/bad-no-condition/test.ts.lint +++ b/test/rules/prefer-while/bad-no-condition/test.ts.lint @@ -1,4 +1,4 @@ for(;;) { -~~~~~~~ [Expected a 'while' loop instead of a 'for' loop without an initializer and incrementor] +~~~~~~~ [Prefer `while` loops instead of `for` loops without an initializer and incrementor.] console.log(x); } diff --git a/test/rules/prefer-while/bad-with-condition/test.ts.lint b/test/rules/prefer-while/bad-with-condition/test.ts.lint index 9bb94dd238b..de6896535f7 100644 --- a/test/rules/prefer-while/bad-with-condition/test.ts.lint +++ b/test/rules/prefer-while/bad-with-condition/test.ts.lint @@ -1,4 +1,4 @@ for(;true===true;) { -~~~~~~~~~~~~~~~~~~ [Expected a 'while' loop instead of a 'for' loop without an initializer and incrementor] +~~~~~~~~~~~~~~~~~~ [Prefer `while` loops instead of `for` loops without an initializer and incrementor.] console.log(x); }