chore(lint): format tools dir

This commit is contained in:
Alex Eagle
2016-05-26 10:45:37 -07:00
parent 5936624d11
commit 9096481744
46 changed files with 633 additions and 654 deletions

View File

@ -1,10 +1,10 @@
import {RuleWalker} from 'tslint/lib/language/walker';
import {RuleFailure} from 'tslint/lib/lint';
import {AbstractRule} from 'tslint/lib/rules';
import {RuleWalker} from 'tslint/lib/language/walker';
import * as ts from 'typescript';
export class Rule extends AbstractRule {
public static FAILURE_STRING = "duplicate module import";
public static FAILURE_STRING = 'duplicate module import';
public apply(sourceFile: ts.SourceFile): RuleFailure[] {
const typedefWalker = new ModuleImportWalker(sourceFile, this.getOptions());
@ -27,12 +27,12 @@ class ModuleImportWalker extends RuleWalker {
private checkTypeAnnotation(location: number, typeAnnotation: ts.TypeNode, name?: ts.Node) {
if (typeAnnotation == null) {
let ns = "<name missing>";
let ns = '<name missing>';
if (name != null && name.kind === ts.SyntaxKind.Identifier) {
ns = (<ts.Identifier>name).text;
}
if (ns.charAt(0) === '_') return;
let failure = this.createFailure(location, 1, "expected parameter " + ns + " to have a type");
let failure = this.createFailure(location, 1, 'expected parameter ' + ns + ' to have a type');
this.addFailure(failure);
}
}
@ -41,7 +41,7 @@ class ModuleImportWalker extends RuleWalker {
var text = moduleSpecifier.getText();
if (this.importModulesSeen.indexOf(text) >= 0) {
let failure =
this.createFailure(moduleSpecifier.getEnd(), 1, "Duplicate imports from module " + text);
this.createFailure(moduleSpecifier.getEnd(), 1, 'Duplicate imports from module ' + text);
this.addFailure(failure);
}
this.importModulesSeen.push(text);