diff --git a/gulpfile.js b/gulpfile.js index 3ac02c625b94c..f8525a5f1902a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -278,6 +278,7 @@ gulp.task('lint', ['build.tools'], function() { // https://github.com/palantir/tslint#supported-rules var tslintConfig = { "rules": { + "semicolon": true, "requireReturnType": true } }; diff --git a/modules/angular2/src/change_detection/change_detection_jit_generator.ts b/modules/angular2/src/change_detection/change_detection_jit_generator.ts index fccbe4214ec57..014b5f120edd2 100644 --- a/modules/angular2/src/change_detection/change_detection_jit_generator.ts +++ b/modules/angular2/src/change_detection/change_detection_jit_generator.ts @@ -182,7 +182,7 @@ export class ChangeDetectorJITGenerator { var lines = ListWrapper.createFixedSize(directiveFieldNames.length); for (var i = 0, iLen = directiveFieldNames.length; i < iLen; ++i) { lines[i] = - `${directiveFieldNames[i]} = directives.getDirectiveFor(${DIRECTIVES_ACCESSOR}[${i}].directiveIndex);` + `${directiveFieldNames[i]} = directives.getDirectiveFor(${DIRECTIVES_ACCESSOR}[${i}].directiveIndex);`; } return lines.join('\n'); } @@ -192,7 +192,7 @@ export class ChangeDetectorJITGenerator { var lines = ListWrapper.createFixedSize(detectorFieldNames.length); for (var i = 0, iLen = detectorFieldNames.length; i < iLen; ++i) { lines[i] = `${detectorFieldNames[i]} = - directives.getDetectorFor(${DIRECTIVES_ACCESSOR}[${i}].directiveIndex);` + directives.getDetectorFor(${DIRECTIVES_ACCESSOR}[${i}].directiveIndex);`; } return lines.join('\n'); } diff --git a/modules/angular2/src/change_detection/parser/parser.ts b/modules/angular2/src/change_detection/parser/parser.ts index 310ef1e0bb959..847195a28c3e0 100644 --- a/modules/angular2/src/change_detection/parser/parser.ts +++ b/modules/angular2/src/change_detection/parser/parser.ts @@ -167,7 +167,7 @@ class _ParseAST { expectIdentifierOrKeyword(): string { var n = this.next; if (!n.isIdentifier() && !n.isKeyword()) { - this.error(`Unexpected token ${n}, expected identifier or keyword`) + this.error(`Unexpected token ${n}, expected identifier or keyword`); } this.advance(); return n.toString(); @@ -176,7 +176,7 @@ class _ParseAST { expectIdentifierOrKeywordOrString(): string { var n = this.next; if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) { - this.error(`Unexpected token ${n}, expected identifier, keyword, or string`) + this.error(`Unexpected token ${n}, expected identifier, keyword, or string`); } this.advance(); return n.toString(); diff --git a/modules/angular2/src/change_detection/pipes/date_pipe.ts b/modules/angular2/src/change_detection/pipes/date_pipe.ts index 8a88af36dbfc1..07aea630de6bf 100644 --- a/modules/angular2/src/change_detection/pipes/date_pipe.ts +++ b/modules/angular2/src/change_detection/pipes/date_pipe.ts @@ -96,5 +96,5 @@ export class DatePipe extends BasePipe implements PipeFactory { supports(obj): boolean { return isDate(obj) || isNumber(obj); } - create(cdRef: ChangeDetectorRef): Pipe { return this } + create(cdRef: ChangeDetectorRef): Pipe { return this; } } diff --git a/modules/angular2/src/change_detection/pipes/iterable_changes.ts b/modules/angular2/src/change_detection/pipes/iterable_changes.ts index 9ae2353994a36..c480db4aa9b56 100644 --- a/modules/angular2/src/change_detection/pipes/iterable_changes.ts +++ b/modules/angular2/src/change_detection/pipes/iterable_changes.ts @@ -130,7 +130,7 @@ export class IterableChanges extends BasePipe { record = this._verifyReinsertion(record, item, index); } record = record._next; - index++ + index++; }); this._length = index; } diff --git a/modules/angular2/src/change_detection/pipes/json_pipe.ts b/modules/angular2/src/change_detection/pipes/json_pipe.ts index ef158e39bb36c..e97e6c1f9cae6 100644 --- a/modules/angular2/src/change_detection/pipes/json_pipe.ts +++ b/modules/angular2/src/change_detection/pipes/json_pipe.ts @@ -29,5 +29,5 @@ import {ChangeDetectorRef} from '../change_detector_ref'; export class JsonPipe extends BasePipe implements PipeFactory { transform(value, args: List = null): string { return Json.stringify(value); } - create(cdRef: ChangeDetectorRef): Pipe { return this } + create(cdRef: ChangeDetectorRef): Pipe { return this; } } diff --git a/modules/angular2/src/change_detection/pipes/number_pipe.ts b/modules/angular2/src/change_detection/pipes/number_pipe.ts index 38a08d4ec65df..d3aaf01216e0e 100644 --- a/modules/angular2/src/change_detection/pipes/number_pipe.ts +++ b/modules/angular2/src/change_detection/pipes/number_pipe.ts @@ -48,7 +48,7 @@ export class NumberPipe extends BasePipe implements PipeFactory { supports(obj): boolean { return isNumber(obj); } - create(cdRef: ChangeDetectorRef): Pipe { return this } + create(cdRef: ChangeDetectorRef): Pipe { return this; } } /** diff --git a/modules/angular2/src/change_detection/pipes/observable_pipe.ts b/modules/angular2/src/change_detection/pipes/observable_pipe.ts index 0c03d09ed8017..4e7b57c389f9a 100644 --- a/modules/angular2/src/change_detection/pipes/observable_pipe.ts +++ b/modules/angular2/src/change_detection/pipes/observable_pipe.ts @@ -65,7 +65,7 @@ export class ObservablePipe implements Pipe { _subscribe(obs: Observable): void { this._observable = obs; - this._subscription = ObservableWrapper.subscribe(obs, value => {this._updateLatestValue(value)}, + this._subscription = ObservableWrapper.subscribe(obs, value => this._updateLatestValue(value), e => { throw e; }); } diff --git a/modules/angular2/src/change_detection/pipes/pipes.ts b/modules/angular2/src/change_detection/pipes/pipes.ts index 5bab56394ea51..068055d4796a4 100644 --- a/modules/angular2/src/change_detection/pipes/pipes.ts +++ b/modules/angular2/src/change_detection/pipes/pipes.ts @@ -95,7 +95,7 @@ export class Pipes { }, // Dependency technically isn't optional, but we can provide a better error message this way. deps: [[Pipes, new UnboundedMetadata(), new OptionalMetadata()]] - }) + }); } private _getListOfFactories(type: string, obj: any): PipeFactory[] { diff --git a/modules/angular2/src/core/annotations/decorators.ts b/modules/angular2/src/core/annotations/decorators.ts index b18485ea827d9..e8badcde4dfe8 100644 --- a/modules/angular2/src/core/annotations/decorators.ts +++ b/modules/angular2/src/core/annotations/decorators.ts @@ -52,7 +52,7 @@ export interface ViewDecorator extends TypeDecorator { renderer?: string, styles?: List, styleUrls?: List, - }): ViewDecorator + }): ViewDecorator; } /** diff --git a/modules/angular2/src/core/application.ts b/modules/angular2/src/core/application.ts index 72b43104da23a..19ea53a632011 100644 --- a/modules/angular2/src/core/application.ts +++ b/modules/angular2/src/core/application.ts @@ -300,7 +300,7 @@ export function bootstrap(appComponentType: Type, bootstrapProcess.resolve(new ApplicationRef(componentRef, appComponentType, appInjector)); }; PromiseWrapper.then(compRefToken, tick, - (err, stackTrace) => {bootstrapProcess.reject(err, stackTrace)}); + (err, stackTrace) => bootstrapProcess.reject(err, stackTrace)); }); return bootstrapProcess.promise; diff --git a/modules/angular2/src/core/compiler/view_manager_utils.ts b/modules/angular2/src/core/compiler/view_manager_utils.ts index 401461134eac7..49ee1874a8800 100644 --- a/modules/angular2/src/core/compiler/view_manager_utils.ts +++ b/modules/angular2/src/core/compiler/view_manager_utils.ts @@ -100,7 +100,7 @@ export class AppViewManagerUtils { if (atIndex == 0) { sibling = null; } else { - sibling = ListWrapper.last(viewContainer.views[atIndex - 1].rootElementInjectors) + sibling = ListWrapper.last(viewContainer.views[atIndex - 1].rootElementInjectors); } var elementInjector = contextView.elementInjectors[contextBoundElementIndex]; for (var i = view.rootElementInjectors.length - 1; i >= 0; i--) { diff --git a/modules/angular2/src/core/zone/ng_zone.ts b/modules/angular2/src/core/zone/ng_zone.ts index c3b17a6f41ef7..09f52393f02d8 100644 --- a/modules/angular2/src/core/zone/ng_zone.ts +++ b/modules/angular2/src/core/zone/ng_zone.ts @@ -62,7 +62,7 @@ export class NgZone { if (global.zone) { this._disabled = false; this._mountZone = global.zone; - this._innerZone = this._createInnerZone(this._mountZone, enableLongStackTrace) + this._innerZone = this._createInnerZone(this._mountZone, enableLongStackTrace); } else { this._disabled = true; this._mountZone = null; @@ -159,9 +159,9 @@ export class NgZone { if (enableLongStackTrace) { errorHandling = StringMapWrapper.merge(Zone.longStackTraceZone, - {onError: function(e) { ngZone._onError(this, e) }}); + {onError: function(e) { ngZone._onError(this, e); }}); } else { - errorHandling = {onError: function(e) { ngZone._onError(this, e) }}; + errorHandling = {onError: function(e) { ngZone._onError(this, e); }}; } return zone.fork(errorHandling) @@ -200,7 +200,7 @@ export class NgZone { } } } - } + }; }, '$scheduleMicrotask': function(parentScheduleMicrotask) { return function(fn) { @@ -213,7 +213,7 @@ export class NgZone { } }; parentScheduleMicrotask.call(this, microtask); - } + }; }, _innerZone: true }); diff --git a/modules/angular2/src/directives/ng_switch.ts b/modules/angular2/src/directives/ng_switch.ts index c8bf53c6d2b75..45f74aac83e1f 100644 --- a/modules/angular2/src/directives/ng_switch.ts +++ b/modules/angular2/src/directives/ng_switch.ts @@ -164,7 +164,7 @@ export class NgSwitchWhen { this._view = new SwitchView(viewContainer, protoViewRef); } - onDestroy() { this._switch } + onDestroy() { this._switch; } set ngSwitchWhen(value) { this._switch._onWhenValueChanged(this._value, value, this._view); diff --git a/modules/angular2/src/facade/collection.ts b/modules/angular2/src/facade/collection.ts index 56bd0f1eadd9c..a364bba1afafc 100644 --- a/modules/angular2/src/facade/collection.ts +++ b/modules/angular2/src/facade/collection.ts @@ -22,7 +22,7 @@ var createMapFromPairs: {(pairs: List): Map} = (function() { map.set(pair[0], pair[1]); } return map; - } + }; })(); var createMapFromMap: {(m: Map): Map} = (function() { try { @@ -35,7 +35,7 @@ var createMapFromMap: {(m: Map): Map} = (function() { var map = new Map(); m.forEach((v, k) => { map.set(k, v); }); return map; - } + }; })(); var _clearValues: {(m: Map)} = (function() { if (((new Map()).keys()).next) { @@ -49,7 +49,7 @@ var _clearValues: {(m: Map)} = (function() { } else { return function _clearValuesWithForeEach(m: Map) { m.forEach((v, k) => { m.set(k, null); }); - } + }; } })(); diff --git a/modules/angular2/src/facade/intl.ts b/modules/angular2/src/facade/intl.ts index 84d3b4fc361a5..e2b0690af6b15 100644 --- a/modules/angular2/src/facade/intl.ts +++ b/modules/angular2/src/facade/intl.ts @@ -14,7 +14,7 @@ declare module Intl { format(value: number): string; } - var NumberFormat: { new (locale?: string, options?: NumberFormatOptions): NumberFormat; } + var NumberFormat: {new (locale?: string, options?: NumberFormatOptions): NumberFormat}; interface DateTimeFormatOptions { localeMatcher?: string; @@ -35,7 +35,7 @@ declare module Intl { format(date?: Date | number): string; } - var DateTimeFormat: { new (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat; } + var DateTimeFormat: {new (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat}; } export enum NumberFormatStyle { diff --git a/modules/angular2/src/forms/validators.ts b/modules/angular2/src/forms/validators.ts index 8190d1523720b..fef986bcf68d6 100644 --- a/modules/angular2/src/forms/validators.ts +++ b/modules/angular2/src/forms/validators.ts @@ -26,7 +26,7 @@ export class Validators { return isPresent(errors) ? StringMapWrapper.merge(res, errors) : res; }, {}); return StringMapWrapper.isEmpty(res) ? null : res; - } + }; } static group(c: modelModule.ControlGroup): StringMap { diff --git a/modules/angular2/src/http/backends/xhr_backend.ts b/modules/angular2/src/http/backends/xhr_backend.ts index a92e283ed787a..e70e2ff51725e 100644 --- a/modules/angular2/src/http/backends/xhr_backend.ts +++ b/modules/angular2/src/http/backends/xhr_backend.ts @@ -42,7 +42,7 @@ export class XHRConnection implements Connection { responseOptions = baseResponseOptions.merge(responseOptions); } - ObservableWrapper.callNext(this.response, new Response(responseOptions)) + ObservableWrapper.callNext(this.response, new Response(responseOptions)); }); // TODO(jeffbcross): make this more dynamic based on body type diff --git a/modules/angular2/src/render/dom/compiler/style_inliner.ts b/modules/angular2/src/render/dom/compiler/style_inliner.ts index 4c003a86f0c68..9ddeaf2320b30 100644 --- a/modules/angular2/src/render/dom/compiler/style_inliner.ts +++ b/modules/angular2/src/render/dom/compiler/style_inliner.ts @@ -80,8 +80,7 @@ export class StyleInliner { if (isPromise(inlinedCss)) { // wait until nested @import are inlined return (>inlinedCss) - .then((css) => {return prefix + this._transformImportedCss(css, mediaQuery, url) + - '\n'}); + .then((css) => prefix + this._transformImportedCss(css, mediaQuery, url) + '\n'); } else { // there are no nested @import, return the css return prefix + this._transformImportedCss(inlinedCss, mediaQuery, url) + '\n'; diff --git a/modules/angular2/src/util/decorators.ts b/modules/angular2/src/util/decorators.ts index 4ae975be0c4cc..0d24ef528797e 100644 --- a/modules/angular2/src/util/decorators.ts +++ b/modules/angular2/src/util/decorators.ts @@ -70,7 +70,7 @@ export interface ParameterDecorator { /** * Invoke as ES7 decorator. */ - (cls: Type, unusedKey: any, index: number): void + (cls: Type, unusedKey: any, index: number): void; } function extractAnnotation(annotation: any): any { diff --git a/modules/angular2/src/web-workers/shared/serializer.ts b/modules/angular2/src/web-workers/shared/serializer.ts index 9aca3d5708527..c247f4d70af1b 100644 --- a/modules/angular2/src/web-workers/shared/serializer.ts +++ b/modules/angular2/src/web-workers/shared/serializer.ts @@ -102,7 +102,7 @@ export class Serializer { class ASTWithSourceSerializer { static serialize(tree: ASTWithSource): Object { - return { 'input': tree.source, 'location': tree.location } + return { 'input': tree.source, 'location': tree.location }; } static deserialize(obj: any, data: string): AST { @@ -186,7 +186,7 @@ class ElementBinderSerializer { 'eventBindings': Serializer.serialize(binder.eventBindings, EventBinding), 'textBindings': Serializer.serialize(binder.textBindings, ASTWithSource), 'readAttributes': Serializer.mapToObject(binder.readAttributes) - } + }; } static deserialize(obj): ElementBinder { @@ -211,7 +211,7 @@ class ProtoViewDtoSerializer { return { 'render': null, 'elementBinders': Serializer.serialize(view.elementBinders, ElementBinder), 'variableBindings': Serializer.mapToObject(view.variableBindings), 'type': view.type - } + }; } static deserialize(obj): ProtoViewDto {