build(tslint): re-enable linter and fix violations

fixes #7798

Closes #7800
This commit is contained in:
Alex Eagle 2016-03-28 14:25:22 -07:00 committed by Alex Eagle
parent 226e662cf1
commit 9a1959f77a
21 changed files with 118 additions and 110 deletions

View File

@ -69,6 +69,7 @@ import {BaseException} from "../../facade/exceptions";
export class NgFor implements DoCheck {
/** @internal */
_ngForOf: any;
/** @internal */
_ngForTrackBy: TrackByFn;
private _differ: IterableDiffer;

View File

@ -74,6 +74,7 @@ export abstract class NgLocalization { abstract getPluralCategory(value: any): s
@Directive({selector: '[ngPluralCase]'})
export class NgPluralCase {
/** @internal */
_view: SwitchView;
constructor(@Attribute('ngPluralCase') public value: string, template: TemplateRef,
viewContainer: ViewContainerRef) {

View File

@ -88,9 +88,12 @@ export class RadioButtonState {
})
export class RadioControlValueAccessor implements ControlValueAccessor,
OnDestroy, OnInit {
/** @internal */
_state: RadioButtonState;
/** @internal */
_control: NgControl;
@Input() name: string;
/** @internal */
_fn: Function;
onChange = () => {};
onTouched = () => {};

View File

@ -44,7 +44,9 @@ function _extractId(valueString: string): string {
})
export class SelectControlValueAccessor implements ControlValueAccessor {
value: any;
/** @internal */
_optionMap: Map<string, any> = new Map<string, any>();
/** @internal */
_idCounter: number = 0;
onChange = (_: any) => {};
@ -63,8 +65,10 @@ export class SelectControlValueAccessor implements ControlValueAccessor {
}
registerOnTouched(fn: () => any): void { this.onTouched = fn; }
/** @internal */
_registerOption(): string { return (this._idCounter++).toString(); }
/** @internal */
_getOptionId(value: any): string {
for (let id of MapWrapper.keys(this._optionMap)) {
if (looseIdentical(this._optionMap.get(id), value)) return id;
@ -72,6 +76,7 @@ export class SelectControlValueAccessor implements ControlValueAccessor {
return null;
}
/** @internal */
_getOptionValue(valueString: string): any {
let value = this._optionMap.get(_extractId(valueString));
return isPresent(value) ? value : valueString;
@ -113,6 +118,7 @@ export class NgSelectOption implements OnDestroy {
this._select.writeValue(this._select.value);
}
/** @internal */
_setElementValue(value: string): void {
this._renderer.setElementProperty(this._element.nativeElement, 'value', value);
}

View File

@ -94,12 +94,14 @@ export class LexedCssResult {
constructor(public error: CssScannerError, public token: CssToken) {}
}
export function generateErrorMessage(input, message, errorValue, index, row, column) {
export function generateErrorMessage(input: string, message: string, errorValue: string,
index: number, row: number, column: number): string {
return `${message} at column ${row}:${column} in expression [` +
findProblemCode(input, errorValue, index, column) + ']';
}
export function findProblemCode(input, errorValue, index, column) {
export function findProblemCode(input: string, errorValue: string, index: number,
column: number): string {
var endOfProblemLine = index;
var current = charCode(input, index);
while (current > 0 && !isNewline(current)) {
@ -163,7 +165,9 @@ export class CssScanner {
column: number = -1;
line: number = 0;
/** @internal */
_currentMode: CssLexerMode = CssLexerMode.BLOCK;
/** @internal */
_currentError: CssScannerError = null;
constructor(public input: string, private _trackComments: boolean = false) {
@ -196,7 +200,7 @@ export class CssScanner {
this.peekPeek = this.peekAt(this.index + 1);
}
peekAt(index): number {
peekAt(index: number): number {
return index >= this.length ? $EOF : StringWrapper.charCodeAt(this.input, index);
}
@ -295,6 +299,7 @@ export class CssScanner {
return new LexedCssResult(error, token);
}
/** @internal */
_scan(): CssToken {
var peek = this.peek;
var peekPeek = this.peekPeek;
@ -348,7 +353,7 @@ export class CssScanner {
return this.error(`Unexpected character [${StringWrapper.fromCharCode(peek)}]`);
}
scanComment() {
scanComment(): CssToken {
if (this.assertCondition(isCommentStart(this.peek, this.peekPeek),
"Expected comment start value")) {
return null;
@ -375,7 +380,7 @@ export class CssScanner {
return new CssToken(start, startingColumn, startingLine, CssTokenType.Comment, str);
}
scanWhitespace() {
scanWhitespace(): CssToken {
var start = this.index;
var startingColumn = this.column;
var startingLine = this.line;
@ -386,7 +391,7 @@ export class CssScanner {
return new CssToken(start, startingColumn, startingLine, CssTokenType.Whitespace, str);
}
scanString() {
scanString(): CssToken {
if (this.assertCondition(isStringStart(this.peek, this.peekPeek),
"Unexpected non-string starting value")) {
return null;
@ -416,7 +421,7 @@ export class CssScanner {
return new CssToken(start, startingColumn, startingLine, CssTokenType.String, str);
}
scanNumber() {
scanNumber(): CssToken {
var start = this.index;
var startingColumn = this.column;
if (this.peek == $PLUS || this.peek == $MINUS) {
@ -436,7 +441,7 @@ export class CssScanner {
return new CssToken(start, startingColumn, this.line, CssTokenType.Number, strValue);
}
scanIdentifier() {
scanIdentifier(): CssToken {
if (this.assertCondition(isIdentifierStart(this.peek, this.peekPeek),
'Expected identifier starting value')) {
return null;
@ -451,7 +456,7 @@ export class CssScanner {
return new CssToken(start, startingColumn, this.line, CssTokenType.Identifier, strValue);
}
scanCssValueFunction() {
scanCssValueFunction(): CssToken {
var start = this.index;
var startingColumn = this.column;
while (this.peek != $EOF && this.peek != $RPAREN) {
@ -461,7 +466,7 @@ export class CssScanner {
return new CssToken(start, startingColumn, this.line, CssTokenType.Identifier, strValue);
}
scanCharacter() {
scanCharacter(): CssToken {
var start = this.index;
var startingColumn = this.column;
if (this.assertCondition(isValidCssCharacter(this.peek, this._currentMode),
@ -475,7 +480,7 @@ export class CssScanner {
return new CssToken(start, startingColumn, this.line, CssTokenType.Character, c);
}
scanAtExpression() {
scanAtExpression(): CssToken {
if (this.assertCondition(this.peek == $AT, 'Expected @ value')) {
return null;
}
@ -521,7 +526,7 @@ function isAtKeyword(current: CssToken, next: CssToken): boolean {
return current.numValue == $AT && next.type == CssTokenType.Identifier;
}
function isCharMatch(target: number, previous: number, code: number) {
function isCharMatch(target: number, previous: number, code: number): boolean {
return code == target && previous != $BACKSLASH;
}
@ -529,11 +534,11 @@ function isDigit(code: number): boolean {
return $0 <= code && code <= $9;
}
function isCommentStart(code: number, next: number) {
function isCommentStart(code: number, next: number): boolean {
return code == $SLASH && next == $STAR;
}
function isCommentEnd(code: number, next: number) {
function isCommentEnd(code: number, next: number): boolean {
return code == $STAR && next == $SLASH;
}
@ -555,12 +560,12 @@ function isIdentifierStart(code: number, next: number): boolean {
target == $MINUS || target == $_;
}
function isIdentifierPart(target: number) {
function isIdentifierPart(target: number): boolean {
return ($a <= target && target <= $z) || ($A <= target && target <= $Z) || target == $BACKSLASH ||
target == $MINUS || target == $_ || isDigit(target);
}
function isValidPseudoSelectorCharacter(code: number) {
function isValidPseudoSelectorCharacter(code: number): boolean {
switch (code) {
case $LPAREN:
case $RPAREN:
@ -570,11 +575,11 @@ function isValidPseudoSelectorCharacter(code: number) {
}
}
function isValidKeyframeBlockCharacter(code: number) {
function isValidKeyframeBlockCharacter(code: number): boolean {
return code == $PERCENT;
}
function isValidAttributeSelectorCharacter(code: number) {
function isValidAttributeSelectorCharacter(code: number): boolean {
// value^*|$~=something
switch (code) {
case $$:
@ -589,7 +594,7 @@ function isValidAttributeSelectorCharacter(code: number) {
}
}
function isValidSelectorCharacter(code: number) {
function isValidSelectorCharacter(code: number): boolean {
// selector [ key = value ]
// IDENT C IDENT C IDENT C
// #id, .class, *+~>
@ -610,7 +615,7 @@ function isValidSelectorCharacter(code: number) {
}
}
function isValidStyleBlockCharacter(code: number) {
function isValidStyleBlockCharacter(code: number): boolean {
// key:value;
// key:calc(something ... )
switch (code) {
@ -630,7 +635,7 @@ function isValidStyleBlockCharacter(code: number) {
}
}
function isValidMediaQueryRuleCharacter(code: number) {
function isValidMediaQueryRuleCharacter(code: number): boolean {
// (min-width: 7.5em) and (orientation: landscape)
switch (code) {
case $LPAREN:
@ -644,7 +649,7 @@ function isValidMediaQueryRuleCharacter(code: number) {
}
}
function isValidAtRuleCharacter(code: number) {
function isValidAtRuleCharacter(code: number): boolean {
// @document url(http://www.w3.org/page?something=on#hash),
switch (code) {
case $LPAREN:
@ -668,7 +673,7 @@ function isValidAtRuleCharacter(code: number) {
}
}
function isValidStyleFunctionCharacter(code: number) {
function isValidStyleFunctionCharacter(code: number): boolean {
switch (code) {
case $PERIOD:
case $MINUS:
@ -684,7 +689,7 @@ function isValidStyleFunctionCharacter(code: number) {
}
}
function isValidBlockCharacter(code: number) {
function isValidBlockCharacter(code: number): boolean {
// @something { }
// IDENT
return code == $AT;

View File

@ -95,7 +95,7 @@ function getDelimFromCharacter(code: number): number {
}
}
function characterContainsDelimiter(code: number, delimiters: number) {
function characterContainsDelimiter(code: number, delimiters: number): boolean {
return bitWiseAnd([getDelimFromCharacter(code), delimiters]) > 0;
}
@ -129,6 +129,7 @@ export class CssParser {
this._file = new ParseSourceFile(this._scanner.input, _fileName);
}
/** @internal */
_resolveBlockType(token: CssToken): BlockType {
switch (token.strValue) {
case '@-o-keyframes':
@ -179,6 +180,7 @@ export class CssParser {
return new ParsedCssResult(errors, ast);
}
/** @internal */
_parseStyleSheet(delimiters): CssStyleSheetAST {
var results = [];
this._scanner.consumeEmptyStatements();
@ -189,6 +191,7 @@ export class CssParser {
return new CssStyleSheetAST(results);
}
/** @internal */
_parseRule(delimiters: number): CssRuleAST {
if (this._scanner.peek == $AT) {
return this._parseAtRule(delimiters);
@ -196,6 +199,7 @@ export class CssParser {
return this._parseSelectorRule(delimiters);
}
/** @internal */
_parseAtRule(delimiters: number): CssRuleAST {
this._scanner.setMode(CssLexerMode.BLOCK);
@ -259,6 +263,7 @@ export class CssParser {
}
}
/** @internal */
_parseSelectorRule(delimiters: number): CssSelectorRuleAST {
var selectors = this._parseSelectors(delimiters);
var block = this._parseStyleBlock(delimiters);
@ -267,6 +272,7 @@ export class CssParser {
return new CssSelectorRuleAST(selectors, block);
}
/** @internal */
_parseSelectors(delimiters: number): CssSelectorAST[] {
delimiters = bitWiseOr([delimiters, LBRACE_DELIM]);
@ -286,6 +292,7 @@ export class CssParser {
return selectors;
}
/** @internal */
_scan(): CssToken {
var output = this._scanner.scan();
var token = output.token;
@ -296,6 +303,7 @@ export class CssParser {
return token;
}
/** @internal */
_consume(type: CssTokenType, value: string = null): CssToken {
var output = this._scanner.consume(type, value);
var token = output.token;
@ -306,6 +314,7 @@ export class CssParser {
return token;
}
/** @internal */
_parseKeyframeBlock(delimiters: number): CssBlockAST {
delimiters = bitWiseOr([delimiters, RBRACE_DELIM]);
this._scanner.setMode(CssLexerMode.KEYFRAME_BLOCK);
@ -322,6 +331,7 @@ export class CssParser {
return new CssBlockAST(definitions);
}
/** @internal */
_parseKeyframeDefinition(delimiters: number): CssKeyframeDefinitionAST {
var stepTokens = [];
delimiters = bitWiseOr([delimiters, LBRACE_DELIM]);
@ -336,11 +346,13 @@ export class CssParser {
return new CssKeyframeDefinitionAST(stepTokens, styles);
}
/** @internal */
_parseKeyframeLabel(delimiters: number): CssToken {
this._scanner.setMode(CssLexerMode.KEYFRAME_BLOCK);
return mergeTokens(this._collectUntilDelim(delimiters));
}
/** @internal */
_parseSelector(delimiters: number): CssSelectorAST {
delimiters = bitWiseOr([delimiters, COMMA_DELIM, LBRACE_DELIM]);
this._scanner.setMode(CssLexerMode.SELECTOR);
@ -435,6 +447,7 @@ export class CssParser {
return new CssSelectorAST(selectorCssTokens, isComplex);
}
/** @internal */
_parseValue(delimiters: number): CssStyleValueAST {
delimiters = bitWiseOr([delimiters, RBRACE_DELIM, SEMICOLON_DELIM, NEWLINE_DELIM]);
@ -489,6 +502,7 @@ export class CssParser {
return new CssStyleValueAST(tokens, strValue);
}
/** @internal */
_collectUntilDelim(delimiters: number, assertType: CssTokenType = null): CssToken[] {
var tokens = [];
while (!characterContainsDelimiter(this._scanner.peek, delimiters)) {
@ -498,6 +512,7 @@ export class CssParser {
return tokens;
}
/** @internal */
_parseBlock(delimiters: number): CssBlockAST {
delimiters = bitWiseOr([delimiters, RBRACE_DELIM]);
@ -519,6 +534,7 @@ export class CssParser {
return new CssBlockAST(results);
}
/** @internal */
_parseStyleBlock(delimiters: number): CssBlockAST {
delimiters = bitWiseOr([delimiters, RBRACE_DELIM, LBRACE_DELIM]);
@ -541,6 +557,7 @@ export class CssParser {
return new CssBlockAST(definitions);
}
/** @internal */
_parseDefinition(delimiters: number): CssDefinitionAST {
this._scanner.setMode(CssLexerMode.STYLE_BLOCK);
@ -600,6 +617,7 @@ export class CssParser {
return new CssDefinitionAST(prop, value);
}
/** @internal */
_assertCondition(status: boolean, errorMessage: string, problemToken: CssToken): boolean {
if (!status) {
this._error(errorMessage, problemToken);
@ -608,6 +626,7 @@ export class CssParser {
return false;
}
/** @internal */
_error(message: string, problemToken: CssToken) {
var length = problemToken.strValue.length;
var error = CssParseError.create(this._file, 0, problemToken.line, problemToken.column, length,

View File

@ -214,7 +214,7 @@ export class CompileFactoryMetadata implements CompileIdentifierMetadata {
get identifier(): CompileIdentifierMetadata { return this; }
toJson() { return null; }
toJson(): {[key: string]: any} { return null; }
}
/**

View File

@ -121,7 +121,7 @@ export class StaticReflector {
}
private conversionMap = new Map<StaticType, (moduleContext: string, expression: any) => any>();
private initializeConversionMap() {
private initializeConversionMap(): any {
let core_metadata = 'angular2/src/core/metadata';
let conversionMap = this.conversionMap;
conversionMap.set(this.getStaticType(core_metadata, 'Directive'),
@ -244,6 +244,7 @@ export class StaticReflector {
(moduleContext, expression) => new HostListenerMetadata(
this.getDecoratorParameter(moduleContext, expression, 0),
this.getDecoratorParameter(moduleContext, expression, 1)));
return null;
}
private convertKnownDecorator(moduleContext: string, expression: {[key: string]: any}): any {

View File

@ -200,7 +200,7 @@ class CodeGenViewFactory implements ViewFactory<Expression, Statement> {
createElementEventListener(renderer: Expression, appView: Expression, boundElementIndex: number,
renderNode: Expression, eventAst: BoundEventAst,
targetStatements: Statement[]) {
targetStatements: Statement[]): Expression {
var disposableVar = this._nextDisposableVar();
var eventHandlerExpr = codeGenEventHandler(appView, boundElementIndex, eventAst.fullName);
targetStatements.push(new Statement(

View File

@ -65,7 +65,7 @@ export class DebugDomRenderer implements Renderer {
if (isPresent(debugParent) && debugParent instanceof DebugElement) {
nodes.forEach((node) => { debugParent.addChild(getDebugNode(node)); });
}
return this._delegate.projectNodes(parentElement, nodes);
this._delegate.projectNodes(parentElement, nodes);
}
attachViewAfter(node: any, viewRootNodes: any[]) {
@ -78,7 +78,7 @@ export class DebugDomRenderer implements Renderer {
debugParent.insertChildrenAfter(debugNode, debugViewRootNodes);
}
}
return this._delegate.attachViewAfter(node, viewRootNodes);
this._delegate.attachViewAfter(node, viewRootNodes);
}
detachView(viewRootNodes: any[]) {
@ -88,15 +88,15 @@ export class DebugDomRenderer implements Renderer {
debugNode.parent.removeChild(debugNode);
}
});
return this._delegate.detachView(viewRootNodes);
this._delegate.detachView(viewRootNodes);
}
destroyView(hostElement: any, viewAllNodes: any[]) {
viewAllNodes.forEach((node) => { removeDebugNodeFromIndex(getDebugNode(node)); });
return this._delegate.destroyView(hostElement, viewAllNodes);
this._delegate.destroyView(hostElement, viewAllNodes);
}
listen(renderElement: any, name: string, callback: Function) {
listen(renderElement: any, name: string, callback: Function): Function {
var debugEl = getDebugNode(renderElement);
if (isPresent(debugEl)) {
debugEl.listeners.push(new EventListener(name, callback));
@ -113,7 +113,7 @@ export class DebugDomRenderer implements Renderer {
if (isPresent(debugEl) && debugEl instanceof DebugElement) {
debugEl.properties.set(propertyName, propertyValue);
}
return this._delegate.setElementProperty(renderElement, propertyName, propertyValue);
this._delegate.setElementProperty(renderElement, propertyName, propertyValue);
}
setElementAttribute(renderElement: any, attributeName: string, attributeValue: string) {
@ -121,7 +121,7 @@ export class DebugDomRenderer implements Renderer {
if (isPresent(debugEl) && debugEl instanceof DebugElement) {
debugEl.attributes.set(attributeName, attributeValue);
}
return this._delegate.setElementAttribute(renderElement, attributeName, attributeValue);
this._delegate.setElementAttribute(renderElement, attributeName, attributeValue);
}
/**
@ -129,7 +129,7 @@ export class DebugDomRenderer implements Renderer {
* such as <template> placeholders.
*/
setBindingDebugInfo(renderElement: any, propertyName: string, propertyValue: string) {
return this._delegate.setBindingDebugInfo(renderElement, propertyName, propertyValue);
this._delegate.setBindingDebugInfo(renderElement, propertyName, propertyValue);
}
/**
@ -138,20 +138,20 @@ export class DebugDomRenderer implements Renderer {
setElementDebugInfo(renderElement: any, info: RenderDebugInfo) {
var debugEl = getDebugNode(renderElement);
debugEl.setDebugInfo(info);
return this._delegate.setElementDebugInfo(renderElement, info);
this._delegate.setElementDebugInfo(renderElement, info);
}
setElementClass(renderElement: any, className: string, isAdd: boolean) {
return this._delegate.setElementClass(renderElement, className, isAdd);
this._delegate.setElementClass(renderElement, className, isAdd);
}
setElementStyle(renderElement: any, styleName: string, styleValue: string) {
return this._delegate.setElementStyle(renderElement, styleName, styleValue);
this._delegate.setElementStyle(renderElement, styleName, styleValue);
}
invokeElementMethod(renderElement: any, methodName: string, args: any[]) {
return this._delegate.invokeElementMethod(renderElement, methodName, args);
this._delegate.invokeElementMethod(renderElement, methodName, args);
}
setText(renderNode: any, text: string) { return this._delegate.setText(renderNode, text); }
setText(renderNode: any, text: string) { this._delegate.setText(renderNode, text); }
}

View File

@ -26,27 +26,29 @@ export abstract class Renderer implements ParentRenderer {
abstract createText(parentElement: any, value: string): any;
abstract projectNodes(parentElement: any, nodes: any[]);
abstract projectNodes(parentElement: any, nodes: any[]): void;
abstract attachViewAfter(node: any, viewRootNodes: any[]);
abstract attachViewAfter(node: any, viewRootNodes: any[]): void;
abstract detachView(viewRootNodes: any[]);
abstract detachView(viewRootNodes: any[]): void;
abstract destroyView(hostElement: any, viewAllNodes: any[]);
abstract destroyView(hostElement: any, viewAllNodes: any[]): void;
abstract listen(renderElement: any, name: string, callback: Function): Function;
abstract listenGlobal(target: string, name: string, callback: Function): Function;
abstract setElementProperty(renderElement: any, propertyName: string, propertyValue: any);
abstract setElementProperty(renderElement: any, propertyName: string, propertyValue: any): void;
abstract setElementAttribute(renderElement: any, attributeName: string, attributeValue: string);
abstract setElementAttribute(renderElement: any, attributeName: string,
attributeValue: string): void;
/**
* Used only in debug mode to serialize property changes to comment nodes,
* such as <template> placeholders.
*/
abstract setBindingDebugInfo(renderElement: any, propertyName: string, propertyValue: string);
abstract setBindingDebugInfo(renderElement: any, propertyName: string,
propertyValue: string): void;
abstract setElementDebugInfo(renderElement: any, info: RenderDebugInfo);

View File

@ -15,6 +15,7 @@ import {ObservableWrapper} from 'angular2/src/facade/async';
export class Testability {
/** @internal */
_pendingCount: number = 0;
/** @internal */
_isZoneStable: boolean = true;
/**
* Whether any work was done since the last 'whenStable' callback. This is

View File

@ -130,7 +130,7 @@ export function removeInterpolation(value: string, source: ParseSourceSpan,
}
}
export function stringifyNodes(nodes: HtmlAst[], parser: Parser) {
export function stringifyNodes(nodes: HtmlAst[], parser: Parser): string {
let visitor = new _StringifyVisitor(parser);
return htmlVisitAll(visitor, nodes).join("");
}
@ -162,4 +162,4 @@ class _StringifyVisitor implements HtmlAstVisitor {
private _join(strs: string[], str: string): string {
return strs.filter(s => s.length > 0).join(str);
}
}
}

View File

@ -486,7 +486,7 @@ export class RouteRegistry {
* Given: ['/a/b', {c: 2}]
* Returns: ['', 'a', 'b', {c: 2}]
*/
function splitAndFlattenLinkParams(linkParams: any[]) {
function splitAndFlattenLinkParams(linkParams: any[]): any[] {
var accumulation = [];
linkParams.forEach(function(item: any) {
if (isString(item)) {

View File

@ -281,6 +281,7 @@ export class Router {
}
private _emitNavigationFinish(url): void { ObservableWrapper.callEmit(this._subject, url); }
/** @internal */
_emitNavigationFail(url): void { ObservableWrapper.callError(this._subject, url); }
private _afterPromiseFinishNavigating(promise: Promise<any>): Promise<any> {

View File

@ -36,5 +36,5 @@ export class RegexRoutePath implements RoutePath {
generateUrl(params: {[key: string]: any}): GeneratedUrl { return this._serializer(params); }
toString() { return this._reString; }
}
toString(): string { return this._reString; }
}

View File

@ -3038,15 +3038,7 @@
}
},
"gulp-tslint": {
"version": "3.6.0",
"dependencies": {
"tslint": {
"version": "2.5.1"
},
"underscore.string": {
"version": "3.1.1"
}
}
"version": "4.3.4"
},
"gulp-typescript": {
"version": "2.10.0",
@ -4623,12 +4615,7 @@
}
},
"rcloader": {
"version": "0.1.4",
"dependencies": {
"lodash": {
"version": "3.10.1"
}
}
"version": "0.2.0"
},
"react": {
"version": "0.14.5"
@ -5836,5 +5823,5 @@
}
},
"name": "angular-srcs",
"version": "2.0.0-beta.11"
"version": "2.0.0-beta.12"
}

41
npm-shrinkwrap.json generated
View File

@ -1,6 +1,6 @@
{
"name": "angular-srcs",
"version": "2.0.0-beta.11",
"version": "2.0.0-beta.12",
"dependencies": {
"abbrev": {
"version": "1.0.7",
@ -4806,21 +4806,9 @@
}
},
"gulp-tslint": {
"version": "3.6.0",
"from": "gulp-tslint@>=3.5.0 <4.0.0",
"resolved": "https://registry.npmjs.org/gulp-tslint/-/gulp-tslint-3.6.0.tgz",
"dependencies": {
"tslint": {
"version": "2.5.1",
"from": "tslint@>=2.5.1 <2.6.0",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-2.5.1.tgz"
},
"underscore.string": {
"version": "3.1.1",
"from": "underscore.string@>=3.1.1 <3.2.0",
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.1.1.tgz"
}
}
"version": "4.3.4",
"from": "gulp-tslint@4.3.4",
"resolved": "https://registry.npmjs.org/gulp-tslint/-/gulp-tslint-4.3.4.tgz"
},
"gulp-typescript": {
"version": "2.10.0",
@ -7365,16 +7353,9 @@
}
},
"rcloader": {
"version": "0.1.4",
"from": "rcloader@>=0.1.4 <0.2.0",
"resolved": "https://registry.npmjs.org/rcloader/-/rcloader-0.1.4.tgz",
"dependencies": {
"lodash": {
"version": "3.10.1",
"from": "lodash@>=3.0.1 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz"
}
}
"version": "0.2.0",
"from": "rcloader@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/rcloader/-/rcloader-0.2.0.tgz"
},
"react": {
"version": "0.14.5",
@ -7818,8 +7799,7 @@
"dependencies": {
"mime-db": {
"version": "1.20.0",
"from": "mime-db@1.20.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.20.0.tgz"
"from": "mime-db@>=1.20.0 <1.21.0"
},
"mime-types": {
"version": "2.1.8",
@ -8712,7 +8692,7 @@
},
"typescript": {
"version": "1.7.5",
"from": "typescript@>=1.7.0 <1.8.0",
"from": "typescript@1.7.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-1.7.5.tgz"
},
"ua-parser-js": {
@ -9305,7 +9285,8 @@
},
"zone.js": {
"version": "0.6.6",
"from": "zone.js@0.6.6"
"from": "zone.js@0.6.6",
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.6.6.tgz"
}
}
}

View File

@ -71,7 +71,7 @@
"gulp-sass": "^2.0.4",
"gulp-shell": "^0.5.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-tslint": "^3.5.0",
"gulp-tslint": "^4.3.4",
"gulp-typescript": "^2.10.0",
"gulp-uglify": "^1.2.0",
"hash-files": "^1.0.0",

View File

@ -393,23 +393,23 @@ const CORE = [
'RenderComponentType',
'RenderComponentType.constructor(id:string, encapsulation:ViewEncapsulation, styles:Array<string|any[]>)',
'Renderer',
'Renderer.attachViewAfter(node:any, viewRootNodes:any[]):any',
'Renderer.attachViewAfter(node:any, viewRootNodes:any[]):void',
'Renderer.createElement(parentElement:any, name:string):any',
'Renderer.createTemplateAnchor(parentElement:any):any',
'Renderer.createText(parentElement:any, value:string):any',
'Renderer.createViewRoot(hostElement:any):any',
'Renderer.destroyView(hostElement:any, viewAllNodes:any[]):any',
'Renderer.detachView(viewRootNodes:any[]):any',
'Renderer.destroyView(hostElement:any, viewAllNodes:any[]):void',
'Renderer.detachView(viewRootNodes:any[]):void',
'Renderer.invokeElementMethod(renderElement:any, methodName:string, args:any[]):any',
'Renderer.listen(renderElement:any, name:string, callback:Function):Function',
'Renderer.listenGlobal(target:string, name:string, callback:Function):Function',
'Renderer.projectNodes(parentElement:any, nodes:any[]):any',
'Renderer.projectNodes(parentElement:any, nodes:any[]):void',
'Renderer.renderComponent(componentType:RenderComponentType):Renderer',
'Renderer.selectRootElement(selector:string):any',
'Renderer.setBindingDebugInfo(renderElement:any, propertyName:string, propertyValue:string):any',
'Renderer.setElementAttribute(renderElement:any, attributeName:string, attributeValue:string):any',
'Renderer.setBindingDebugInfo(renderElement:any, propertyName:string, propertyValue:string):void',
'Renderer.setElementAttribute(renderElement:any, attributeName:string, attributeValue:string):void',
'Renderer.setElementClass(renderElement:any, className:string, isAdd:boolean):any',
'Renderer.setElementProperty(renderElement:any, propertyName:string, propertyValue:any):any',
'Renderer.setElementProperty(renderElement:any, propertyName:string, propertyValue:any):void',
'Renderer.setElementStyle(renderElement:any, styleName:string, styleValue:string):any',
'Renderer.setText(renderNode:any, text:string):any',
'Renderer.setElementDebugInfo(renderElement:any, info:RenderDebugInfo):any',

View File

@ -44,18 +44,18 @@ class TypedefWalker extends RuleWalker {
private handleCallSignature(node: ts.SignatureDeclaration) {
// set accessors can't have a return type.
if (node.kind !== ts.SyntaxKind.SetAccessor) {
this.checkTypeAnnotation(node.type, node.name);
this.checkTypeAnnotation(node.type, node.name, node.getStart());
}
}
private checkTypeAnnotation(typeAnnotation: ts.TypeNode, name?: ts.Node) {
private checkTypeAnnotation(typeAnnotation: ts.TypeNode, name: ts.Node, start: number) {
if (typeAnnotation == null) {
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(null, 1, "expected " + ns + " to have a return type");
let failure = this.createFailure(start, 1, "expected " + ns + " to have a return type");
this.addFailure(failure);
}
}