refactor(TypeScript): Add noImplicitAny

We automatically insert explicit 'any's where needed. These need to be
addressed as in #9100.

Fixes #4924
This commit is contained in:
ScottSWu
2016-06-08 15:45:15 -07:00
parent 87d824e1b4
commit 86fbd50c3d
305 changed files with 2338 additions and 2337 deletions

View File

@ -232,7 +232,7 @@ export function Class(clsDef: ClassDefinition): ConcreteType {
}
if (!constructor['name']) {
constructor['overriddenName'] = `class${_nextClassId++}`;
(constructor as any /** TODO #9100 */)['overriddenName'] = `class${_nextClassId++}`;
}
return <ConcreteType>constructor;
@ -248,8 +248,8 @@ var Reflect = global.Reflect;
})();
export function makeDecorator(
annotationCls, chainFn: (fn: Function) => void = null): (...args: any[]) => (cls: any) => any {
function DecoratorFactory(objOrType): (cls: any) => any {
annotationCls: any /** TODO #9100 */, chainFn: (fn: Function) => void = null): (...args: any[]) => (cls: any) => any {
function DecoratorFactory(objOrType: any /** TODO #9100 */): (cls: any) => any {
var annotationInstance = new (<any>annotationCls)(objOrType);
if (this instanceof annotationCls) {
return annotationInstance;
@ -257,7 +257,7 @@ export function makeDecorator(
var chainAnnotation =
isFunction(this) && this.annotations instanceof Array ? this.annotations : [];
chainAnnotation.push(annotationInstance);
var TypeDecorator: TypeDecorator = <TypeDecorator>function TypeDecorator(cls) {
var TypeDecorator: TypeDecorator = <TypeDecorator>function TypeDecorator(cls: any /** TODO #9100 */) {
var annotations = Reflect.getOwnMetadata('annotations', cls);
annotations = annotations || [];
annotations.push(annotationInstance);
@ -275,8 +275,8 @@ export function makeDecorator(
return DecoratorFactory;
}
export function makeParamDecorator(annotationCls): any {
function ParamDecoratorFactory(...args): any {
export function makeParamDecorator(annotationCls: any /** TODO #9100 */): any {
function ParamDecoratorFactory(...args: any[] /** TODO #9100 */): any {
var annotationInstance = Object.create(annotationCls.prototype);
annotationCls.apply(annotationInstance, args);
if (this instanceof annotationCls) {
@ -287,7 +287,7 @@ export function makeParamDecorator(annotationCls): any {
}
function ParamDecorator(cls, unusedKey, index): any {
function ParamDecorator(cls: any /** TODO #9100 */, unusedKey: any /** TODO #9100 */, index: any /** TODO #9100 */): any {
var parameters: any[][] = Reflect.getMetadata('parameters', cls);
parameters = parameters || [];
@ -310,8 +310,8 @@ export function makeParamDecorator(annotationCls): any {
return ParamDecoratorFactory;
}
export function makePropDecorator(annotationCls): any {
function PropDecoratorFactory(...args): any {
export function makePropDecorator(annotationCls: any /** TODO #9100 */): any {
function PropDecoratorFactory(...args: any[] /** TODO #9100 */): any {
var decoratorInstance = Object.create(annotationCls.prototype);
annotationCls.apply(decoratorInstance, args);