Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion src/chaiVagueErrorsRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const FAILURE_STRING: string = BASE_ERROR + 'Please add an explicit failure mess
const FAILURE_STRING_COMPARE_TRUE: string =
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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: dot was added to previous error message, but removed from this one. Nice to have them consistent.


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