tslint-no-unused-expression-chai
Version:
Custom tslint no-unused-expression rule supports chai's expect assertion
32 lines (31 loc) • 1.13 kB
TypeScript
import * as ts from 'typescript';
import * as Lint from 'tslint';
import { Rule as BaseUnusedExpressionRule } from 'tslint/lib/rules/noUnusedExpressionRule';
/**
* Implements no-unused-expression-chai rules
* To honor base rule's behavior, it inherits from default no-unused-expression rule
* and override specific failure only
*
*/
export declare class Rule extends BaseUnusedExpressionRule {
static metadata: {
ruleName: string;
type: Lint.RuleType;
deprecationMessage?: string | undefined;
description: string;
descriptionDetails?: string | undefined;
hasFix?: boolean | undefined;
optionsDescription: string;
options: any;
optionExamples?: string[] | (true | any[])[] | undefined;
rationale?: string | undefined;
requiresTypeInfo?: boolean | undefined;
typescriptOnly: boolean;
codeExamples?: Lint.ICodeExample[] | undefined;
};
/**
* Apply rules. Simply walk source by default rule first, and filter out chai expression
*
*/
apply(sourceFile: ts.SourceFile): Lint.RuleFailure[];
}