From ec8b337384199f9d9a30ad71346b1e42c8824a38 Mon Sep 17 00:00:00 2001 From: "ryan.waskiewicz" Date: Tue, 1 May 2018 20:28:28 -0400 Subject: [PATCH] Update rule description & failure string - Updated the description and failure string of prefer-while - Updated tests accordingly --- src/rules/preferWhileRule.ts | 4 ++-- test/rules/prefer-while/bad-no-condition/test.ts.lint | 2 +- test/rules/prefer-while/bad-with-condition/test.ts.lint | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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); }