Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Merge 734f485 into 33d330e
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Goldberg authored Dec 4, 2018
2 parents 33d330e + 734f485 commit 95d0307
Show file tree
Hide file tree
Showing 233 changed files with 3,364 additions and 6,940 deletions.
2 changes: 1 addition & 1 deletion src/chaiPreferContainsToIndexOfRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AstUtils } from './utils/AstUtils';
import { ChaiUtils } from './utils/ChaiUtils';
import { ExtendedMetadata } from './utils/ExtendedMetadata';

const FAILURE_STRING: string = 'Found chai call with indexOf that can be converted to .contain assertion: ';
const FAILURE_STRING: string = 'Found chai call with indexOf that can be converted to .contain assertion:';

export class Rule extends Lint.Rules.AbstractRule {
public static metadata: ExtendedMetadata = {
Expand Down
4 changes: 2 additions & 2 deletions src/chaiVagueErrorsRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { ExtendedMetadata } from './utils/ExtendedMetadata';
const BASE_ERROR: string = 'Found chai call with vague failure message. ';
const FAILURE_STRING: string = BASE_ERROR + 'Please add an explicit failure message';
const FAILURE_STRING_COMPARE_TRUE: string =
BASE_ERROR + 'Move the strict equality comparison from the expect call into the assertion value';
BASE_ERROR + 'Move the strict equality comparison from the expect call into the assertion value.';
const FAILURE_STRING_COMPARE_FALSE: string =
BASE_ERROR + 'Move the strict inequality comparison from the expect call into the assertion value. ';
BASE_ERROR + 'Move the strict inequality comparison from the expect call into the assertion value';

export class Rule extends Lint.Rules.AbstractRule {
public static metadata: ExtendedMetadata = {
Expand Down
2 changes: 1 addition & 1 deletion src/missingJsdocRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class Rule extends Lint.Rules.AbstractRule {
class MissingJSDocWalker extends Lint.RuleWalker {
protected visitSourceFile(node: ts.SourceFile): void {
if (!/^\/\*\*\s*$/gm.test(node.getFullText())) {
this.addFailureAt(node.getStart(), node.getWidth(), Rule.FAILURE_STRING);
this.addFailureAt(0, 0, Rule.FAILURE_STRING);
}
// do not continue walking
}
Expand Down
4 changes: 2 additions & 2 deletions src/noBackboneGetSetOutsideModelRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ class NoBackboneGetSetOutsideModelRuleWalker extends Lint.RuleWalker {
const functionName: string = AstUtils.getFunctionName(node);
if (functionName === 'get' && node.arguments.length === 1 && node.arguments[0].kind === ts.SyntaxKind.StringLiteral) {
const msg: string = Rule.GET_FAILURE_STRING + node.getText();
this.addFailureAt(node.getStart(), node.getEnd(), msg);
this.addFailureAt(node.getStart(), node.getWidth(), msg);
}
if (functionName === 'set' && node.arguments.length === 2 && node.arguments[0].kind === ts.SyntaxKind.StringLiteral) {
const msg: string = Rule.SET_FAILURE_STRING + node.getText();
this.addFailureAt(node.getStart(), node.getEnd(), msg);
this.addFailureAt(node.getStart(), node.getWidth(), msg);
}
}
super.visitCallExpression(node);
Expand Down
4 changes: 2 additions & 2 deletions src/noSuspiciousCommentRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ExtendedMetadata } from './utils/ExtendedMetadata';

const FAILURE_STRING: string = 'Suspicious comment found: ';
const SUSPICIOUS_WORDS = ['BUG', 'HACK', 'FIXME', 'LATER', 'LATER2', 'TODO'];
const FAILURE_STRING_OPTION: string = '\nTo disable this warning, the comment should include one of the following regex: ';
const FAILURE_STRING_OPTION: string = 'To disable this warning, the comment should include one of the following regex: ';

export class Rule extends Lint.Rules.AbstractRule {
public static metadata: ExtendedMetadata = {
Expand Down Expand Up @@ -76,7 +76,7 @@ class NoSuspiciousCommentRuleWalker extends Lint.RuleWalker {
private foundSuspiciousComment(startPosition: number, commentText: string, suspiciousWord: string) {
let errorMessage: string = FAILURE_STRING + suspiciousWord;
if (this.exceptionRegex.length > 0) {
errorMessage += '.' + this.getFailureMessageWithExceptionRegexOption();
errorMessage += '. ' + this.getFailureMessageWithExceptionRegexOption();
}
this.addFailureAt(startPosition, commentText.length, errorMessage);
}
Expand Down
84 changes: 0 additions & 84 deletions src/tests/ChaiPreferContainsToIndexOfRuleTests.ts

This file was deleted.

Loading

0 comments on commit 95d0307

Please sign in to comment.