chore(lint): require semicolons

Relying on ASI (automatic semicolon insertion)
is allowed in TypeScript because JavaScript allows
it. However, when we run clang-format it doesn’t
understand that these statements are terminated
with a newline and changes the indentation, in bad
cases even breaking the code.

Fixes #817
This commit is contained in:
Alex Eagle
2015-07-15 12:12:23 -07:00
parent 33500e986b
commit 93055f78ea
21 changed files with 32 additions and 32 deletions

View File

@ -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');
}

View File

@ -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();

View File

@ -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; }
}

View File

@ -130,7 +130,7 @@ export class IterableChanges extends BasePipe {
record = this._verifyReinsertion(record, item, index);
}
record = record._next;
index++
index++;
});
this._length = index;
}

View File

@ -29,5 +29,5 @@ import {ChangeDetectorRef} from '../change_detector_ref';
export class JsonPipe extends BasePipe implements PipeFactory {
transform(value, args: List<any> = null): string { return Json.stringify(value); }
create(cdRef: ChangeDetectorRef): Pipe { return this }
create(cdRef: ChangeDetectorRef): Pipe { return this; }
}

View File

@ -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; }
}
/**

View File

@ -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; });
}

View File

@ -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[] {