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

Converted open rule tests from c* to no-* #665

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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 @@ -6,7 +6,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 @@ -8,9 +8,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';
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
4 changes: 2 additions & 2 deletions src/noSuspiciousCommentRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface Options {

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 @@ -85,7 +85,7 @@ function walk(ctx: Lint.WalkContext<Options>) {
function foundSuspiciousComment(startPosition: number, commentText: string, suspiciousWord: string) {
let errorMessage: string = FAILURE_STRING + suspiciousWord;
if (exceptionRegex.length > 0) {
errorMessage += '.' + getFailureMessageWithExceptionRegexOption();
errorMessage += '. ' + getFailureMessageWithExceptionRegexOption();
}
ctx.addFailureAt(startPosition, commentText.length, errorMessage);
}
Expand Down
4 changes: 1 addition & 3 deletions src/noUnnecessaryBindRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export class Rule extends Lint.Rules.AbstractRule {

public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
if (Rule.isWarningShown === false) {
console.warn(
'Warning: no-unnecessary-bind rule is deprecated. Replace your usage with the TSLint unnecessary-bind rule.'
);
console.warn('Warning: no-unnecessary-bind rule is deprecated. Replace your usage with the TSLint unnecessary-bind rule.');
Rule.isWarningShown = true;
}

Expand Down
84 changes: 0 additions & 84 deletions src/tests/ChaiPreferContainsToIndexOfRuleTests.ts

This file was deleted.

Loading