Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tslint): update tslint to 4.x #13603

Merged
merged 2 commits into from
Dec 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/@angular/compiler-cli/src/private_import_core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import {__core_private__ as r} from '@angular/core';

export type ReflectorReader = typeof r._ReflectorReader;
export var ReflectorReader: typeof r.ReflectorReader = r.ReflectorReader;
export const ReflectorReader: typeof r.ReflectorReader = r.ReflectorReader;

export type ReflectionCapabilities = typeof r._ReflectionCapabilities;
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export const ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;

export type Console = typeof r._Console;
export var Console: typeof r.Console = r.Console;
export const Console: typeof r.Console = r.Console;
6 changes: 2 additions & 4 deletions modules/@angular/compiler-cli/test/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,9 @@ export class MockCompilerHost implements ts.CompilerHost {
return ts.getDefaultLibFileName(options);
}

writeFile: ts.WriteFileCallback = (fileName, text) => { this.context.writeFile(fileName, text); }
writeFile: ts.WriteFileCallback = (fileName, text) => { this.context.writeFile(fileName, text); };

getCurrentDirectory(): string {
return this.context.currentDirectory;
}
getCurrentDirectory(): string { return this.context.currentDirectory; }

getCanonicalFileName(fileName: string): string { return fileName; }

Expand Down
4 changes: 2 additions & 2 deletions modules/@angular/compiler-cli/test/private_import_core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
import {__core_private__ as r} from '@angular/core';

export type ReflectionCapabilities = typeof r._ReflectionCapabilities;
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export var reflector: typeof r.reflector = r.reflector;
export const ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export const reflector: typeof r.reflector = r.reflector;
2 changes: 1 addition & 1 deletion modules/@angular/compiler/src/expression_parser/lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function newErrorToken(index: number, message: string): Token {
return new Token(index, TokenType.Error, 0, message);
}

export var EOF: Token = new Token(-1, TokenType.Character, 0, '');
export const EOF: Token = new Token(-1, TokenType.Character, 0, '');

class _Scanner {
length: number;
Expand Down
26 changes: 13 additions & 13 deletions modules/@angular/compiler/src/output/output_ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ export class MapType extends Type {
visitType(visitor: TypeVisitor, context: any): any { return visitor.visitMapType(this, context); }
}

export var DYNAMIC_TYPE = new BuiltinType(BuiltinTypeName.Dynamic);
export var BOOL_TYPE = new BuiltinType(BuiltinTypeName.Bool);
export var INT_TYPE = new BuiltinType(BuiltinTypeName.Int);
export var NUMBER_TYPE = new BuiltinType(BuiltinTypeName.Number);
export var STRING_TYPE = new BuiltinType(BuiltinTypeName.String);
export var FUNCTION_TYPE = new BuiltinType(BuiltinTypeName.Function);
export var NULL_TYPE = new BuiltinType(BuiltinTypeName.Null);
export const DYNAMIC_TYPE = new BuiltinType(BuiltinTypeName.Dynamic);
export const BOOL_TYPE = new BuiltinType(BuiltinTypeName.Bool);
export const INT_TYPE = new BuiltinType(BuiltinTypeName.Int);
export const NUMBER_TYPE = new BuiltinType(BuiltinTypeName.Number);
export const STRING_TYPE = new BuiltinType(BuiltinTypeName.String);
export const FUNCTION_TYPE = new BuiltinType(BuiltinTypeName.Function);
export const NULL_TYPE = new BuiltinType(BuiltinTypeName.Null);

export interface TypeVisitor {
visitBuiltintType(type: BuiltinType, context: any): any;
Expand Down Expand Up @@ -451,12 +451,12 @@ export interface ExpressionVisitor {
visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any;
}

export var THIS_EXPR = new ReadVarExpr(BuiltinVar.This);
export var SUPER_EXPR = new ReadVarExpr(BuiltinVar.Super);
export var CATCH_ERROR_VAR = new ReadVarExpr(BuiltinVar.CatchError);
export var CATCH_STACK_VAR = new ReadVarExpr(BuiltinVar.CatchStack);
export var NULL_EXPR = new LiteralExpr(null, null);
export var TYPED_NULL_EXPR = new LiteralExpr(null, NULL_TYPE);
export const THIS_EXPR = new ReadVarExpr(BuiltinVar.This);
export const SUPER_EXPR = new ReadVarExpr(BuiltinVar.Super);
export const CATCH_ERROR_VAR = new ReadVarExpr(BuiltinVar.CatchError);
export const CATCH_STACK_VAR = new ReadVarExpr(BuiltinVar.CatchStack);
export const NULL_EXPR = new LiteralExpr(null, null);
export const TYPED_NULL_EXPR = new LiteralExpr(null, NULL_TYPE);

//// Statements
export enum StmtModifier {
Expand Down
2 changes: 1 addition & 1 deletion modules/@angular/compiler/src/url_resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function createOfflineCompileUrlResolver(): UrlResolver {
/**
* A default provider for {@link PACKAGE_ROOT_URL} that maps to '/'.
*/
export var DEFAULT_PACKAGE_URL_PROVIDER = {
export const DEFAULT_PACKAGE_URL_PROVIDER = {
provide: PACKAGE_ROOT_URL,
useValue: '/'
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ type EventSummary = {
name: string,
target: string,
phase: string
}
};
4 changes: 2 additions & 2 deletions modules/@angular/compiler/test/output/output_emitter_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const baseErrorIdentifier = {
runtime: BaseError
};

export var codegenExportsVars = [
export const codegenExportsVars = [
'getExpressions',
];

Expand Down Expand Up @@ -190,7 +190,7 @@ const _getExpressionsStmts: o.Statement[] = [
]))
];

export var codegenStmts: o.Statement[] = [
export const codegenStmts: o.Statement[] = [
new o.CommentStmt('This is a comment'),

new o.ClassStmt(
Expand Down
8 changes: 3 additions & 5 deletions modules/@angular/compiler/testing/private_import_core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
import {__core_private__ as r} from '@angular/core';

export type ViewMetadata = typeof r._ViewMetadata;
export var ViewMetadata: typeof r.ViewMetadata = r.ViewMetadata;


export const ViewMetadata: typeof r.ViewMetadata = r.ViewMetadata;

import {__core_private_testing__ as r2} from '@angular/core/testing';

export type TestingCompiler = typeof r2._TestingCompiler;
export var TestingCompiler: typeof r2.TestingCompiler = r2.TestingCompiler;
export const TestingCompiler: typeof r2.TestingCompiler = r2.TestingCompiler;

export type TestingCompilerFactory = typeof r2._TestingCompilerFactory;
export var TestingCompilerFactory: typeof r2.TestingCompilerFactory = r2.TestingCompilerFactory;
export const TestingCompilerFactory: typeof r2.TestingCompilerFactory = r2.TestingCompilerFactory;
2 changes: 1 addition & 1 deletion modules/@angular/compiler/testing/test_bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function createUrlResolverWithoutPackagePrefix(): UrlResolver {
// This provider is put here just so that we can access it from multiple
// internal test packages.
// TODO: get rid of it or move to a separate @angular/internal_testing package
export var TEST_COMPILER_PROVIDERS: Provider[] = [
export const TEST_COMPILER_PROVIDERS: Provider[] = [
{provide: ElementSchemaRegistry, useValue: new MockSchemaRegistry({}, {}, {}, [], [])},
{provide: ResourceLoader, useClass: MockResourceLoader},
{provide: UrlResolver, useFactory: createUrlResolverWithoutPackagePrefix}
Expand Down
2 changes: 1 addition & 1 deletion modules/@angular/core/src/core_private_export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import * as api from './render/api';
import * as decorators from './util/decorators';
import {isPromise} from './util/lang';

export var __core_private__: {
export const __core_private__: {
isDefaultChangeDetectionStrategy: typeof constants.isDefaultChangeDetectionStrategy,
ChangeDetectorStatus: typeof constants.ChangeDetectorStatus,
_ChangeDetectorStatus?: constants.ChangeDetectorStatus,
Expand Down
8 changes: 4 additions & 4 deletions modules/@angular/core/src/profile/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function noopScope(arg0?: any, arg1?: any): any {
*
* @experimental
*/
export var wtfCreateScope: (signature: string, flags?: any) => WtfScopeFn =
export const wtfCreateScope: (signature: string, flags?: any) => WtfScopeFn =
wtfEnabled ? createScope : (signature: string, flags?: any) => noopScope;

/**
Expand All @@ -62,7 +62,7 @@ export var wtfCreateScope: (signature: string, flags?: any) => WtfScopeFn =
* Returns the `returnValue for easy chaining.
* @experimental
*/
export var wtfLeave: <T>(scope: any, returnValue?: T) => T =
export const wtfLeave: <T>(scope: any, returnValue?: T) => T =
wtfEnabled ? leave : (s: any, r?: any) => r;

/**
Expand All @@ -78,7 +78,7 @@ export var wtfLeave: <T>(scope: any, returnValue?: T) => T =
* }
* @experimental
*/
export var wtfStartTimeRange: (rangeType: string, action: string) => any =
export const wtfStartTimeRange: (rangeType: string, action: string) => any =
wtfEnabled ? startTimeRange : (rangeType: string, action: string) => null;

/**
Expand All @@ -87,4 +87,4 @@ export var wtfStartTimeRange: (rangeType: string, action: string) => any =
* enabled.
* @experimental
*/
export var wtfEndTimeRange: (range: any) => void = wtfEnabled ? endTimeRange : (r: any) => null;
export const wtfEndTimeRange: (range: any) => void = wtfEnabled ? endTimeRange : (r: any) => null;
2 changes: 1 addition & 1 deletion modules/@angular/core/test/reflection/reflector_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export function main() {
static ctorParameters = () =>
[{type: A, decorators: [{type: ParamDecorator, args: ['a']}]},
{type: B, decorators: [{type: ParamDecorator, args: ['b']}]},
];
]
}

class Child extends Parent {}
Expand Down
2 changes: 1 addition & 1 deletion modules/@angular/core/testing/private_export_testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import * as mock_animation_player from './mock_animation_player';
import * as test_compiler from './test_compiler';

export var __core_private_testing__: {
export const __core_private_testing__: {
TestingCompiler: typeof test_compiler.TestingCompiler,
_TestingCompiler?: test_compiler.TestingCompiler,
TestingCompilerFactory: typeof test_compiler.TestingCompilerFactory,
Expand Down
2 changes: 1 addition & 1 deletion modules/@angular/core/testing/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ if (_global.beforeEach) {

// TODO(juliemr): remove this, only used because we need to export something to have compilation
// work.
export var __core_private_testing_placeholder__ = '';
export const __core_private_testing_placeholder__ = '';
6 changes: 3 additions & 3 deletions modules/@angular/core/testing/testing_internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ export {inject} from './test_bed';
export * from './logger';
export * from './ng_zone_mock';

export var proxy: ClassDecorator = (t: any) => t;
export const proxy: ClassDecorator = (t: any) => t;

const _global = <any>(typeof window === 'undefined' ? global : window);

export var afterEach: Function = _global.afterEach;
export var expect: (actual: any) => jasmine.Matchers = _global.expect;
export const afterEach: Function = _global.afterEach;
export const expect: (actual: any) => jasmine.Matchers = _global.expect;

const jsmBeforeEach = _global.beforeEach;
const jsmDescribe = _global.describe;
Expand Down
2 changes: 1 addition & 1 deletion modules/@angular/language-service/test/test_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type MockData = string | MockDirectory;

export type MockDirectory = {
[name: string]: MockData | undefined;
}
};

const angularts = /@angular\/(\w|\/|-)+\.tsx?$/;
const rxjsts = /rxjs\/(\w|\/)+\.tsx?$/;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import {INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from './platform_providers';
import * as resource_loader from './resource_loader/resource_loader_impl';

export var __platform_browser_dynamic_private__: {
export const __platform_browser_dynamic_private__: {
INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: typeof INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
_ResourceLoaderImpl?: resource_loader.ResourceLoaderImpl,
ResourceLoaderImpl: typeof resource_loader.ResourceLoaderImpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

import {__core_private__ as r} from '@angular/core';

export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export var reflector: typeof r.reflector = r.reflector;
export var Console: typeof r.Console = r.Console;
export const ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export const reflector: typeof r.reflector = r.reflector;
export const Console: typeof r.Console = r.Console;
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

import {__platform_browser_private__ as _} from '@angular/platform-browser';

export var INTERNAL_BROWSER_PLATFORM_PROVIDERS: typeof _.INTERNAL_BROWSER_PLATFORM_PROVIDERS =
export const INTERNAL_BROWSER_PLATFORM_PROVIDERS: typeof _.INTERNAL_BROWSER_PLATFORM_PROVIDERS =
_.INTERNAL_BROWSER_PLATFORM_PROVIDERS;
export var getDOM: typeof _.getDOM = _.getDOM;
export const getDOM: typeof _.getDOM = _.getDOM;
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {TestComponentRenderer} from '@angular/core/testing';
import {DOCUMENT} from '@angular/platform-browser';
import {getDOM} from './private_import_platform-browser';



/**
* A DOM based implementation of the TestComponentRenderer.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import * as testing from './dom_test_component_renderer';

export var __platform_browser_dynamic_private__:
export const __platform_browser_dynamic_private__:
{DOMTestComponentRenderer: typeof testing.DOMTestComponentRenderer} = {
DOMTestComponentRenderer: testing.DOMTestComponentRenderer
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

import {__platform_browser_dynamic_private__ as _} from '@angular/platform-browser-dynamic';

export var INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS:
export const INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS:
typeof _.INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS =
_.INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS;
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

import {__platform_browser_private__ as _} from '@angular/platform-browser';

export var getDOM: typeof _.getDOM = _.getDOM;
export const getDOM: typeof _.getDOM = _.getDOM;
2 changes: 1 addition & 1 deletion modules/@angular/platform-browser/src/private_export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import * as key_events from './dom/events/key_events';
import * as shared_styles_host from './dom/shared_styles_host';
import {WebAnimationsDriver} from './dom/web_animations_driver';

export var __platform_browser_private__: {
export const __platform_browser_private__: {
_BrowserPlatformLocation?: location.BrowserPlatformLocation,
BrowserPlatformLocation: typeof location.BrowserPlatformLocation,
_DomAdapter?: dom_adapter.DomAdapter,
Expand Down
28 changes: 14 additions & 14 deletions modules/@angular/platform-browser/src/private_import_core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@
import {__core_private__ as r} from '@angular/core';

export type RenderDebugInfo = typeof r._RenderDebugInfo;
export var RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo;
export const RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo;
export type DirectRenderer = typeof r._DirectRenderer;

export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export const ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;

export type DebugDomRootRenderer = typeof r._DebugDomRootRenderer;
export var DebugDomRootRenderer: typeof r.DebugDomRootRenderer = r.DebugDomRootRenderer;
export var reflector: typeof r.reflector = r.reflector;
export const DebugDomRootRenderer: typeof r.DebugDomRootRenderer = r.DebugDomRootRenderer;
export const reflector: typeof r.reflector = r.reflector;

export type NoOpAnimationPlayer = typeof r._NoOpAnimationPlayer;
export var NoOpAnimationPlayer: typeof r.NoOpAnimationPlayer = r.NoOpAnimationPlayer;
export const NoOpAnimationPlayer: typeof r.NoOpAnimationPlayer = r.NoOpAnimationPlayer;
export type AnimationPlayer = typeof r._AnimationPlayer;
export var AnimationPlayer: typeof r.AnimationPlayer = r.AnimationPlayer;
export const AnimationPlayer: typeof r.AnimationPlayer = r.AnimationPlayer;
export type AnimationSequencePlayer = typeof r._AnimationSequencePlayer;
export var AnimationSequencePlayer: typeof r.AnimationSequencePlayer = r.AnimationSequencePlayer;
export const AnimationSequencePlayer: typeof r.AnimationSequencePlayer = r.AnimationSequencePlayer;
export type AnimationGroupPlayer = typeof r._AnimationGroupPlayer;
export var AnimationGroupPlayer: typeof r.AnimationGroupPlayer = r.AnimationGroupPlayer;
export const AnimationGroupPlayer: typeof r.AnimationGroupPlayer = r.AnimationGroupPlayer;
export type AnimationKeyframe = typeof r._AnimationKeyframe;
export var AnimationKeyframe: typeof r.AnimationKeyframe = r.AnimationKeyframe;
export const AnimationKeyframe: typeof r.AnimationKeyframe = r.AnimationKeyframe;
export type AnimationStyles = typeof r._AnimationStyles;
export var AnimationStyles: typeof r.AnimationStyles = r.AnimationStyles;
export var prepareFinalAnimationStyles: typeof r.prepareFinalAnimationStyles =
export const AnimationStyles: typeof r.AnimationStyles = r.AnimationStyles;
export const prepareFinalAnimationStyles: typeof r.prepareFinalAnimationStyles =
r.prepareFinalAnimationStyles;
export var balanceAnimationKeyframes: typeof r.balanceAnimationKeyframes =
export const balanceAnimationKeyframes: typeof r.balanceAnimationKeyframes =
r.balanceAnimationKeyframes;
export var clearStyles: typeof r.clearStyles = r.clearStyles;
export var collectAndResolveStyles: typeof r.collectAndResolveStyles = r.collectAndResolveStyles;
export const clearStyles: typeof r.clearStyles = r.clearStyles;
export const collectAndResolveStyles: typeof r.collectAndResolveStyles = r.collectAndResolveStyles;
6 changes: 3 additions & 3 deletions modules/@angular/platform-browser/testing/browser_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {NgZone} from '@angular/core';
import {global} from './facade/lang';
import {getDOM} from './private_import_platform-browser';

export let browserDetection: BrowserDetection;

export class BrowserDetection {
private _overrideUa: string;
private get _ua(): string {
Expand Down Expand Up @@ -133,8 +135,6 @@ export function stringifyElement(el: any /** TODO #9100 */): string {
return result;
}

export var browserDetection: BrowserDetection = new BrowserDetection(null);

export function createNgZone(): NgZone {
return new NgZone({enableLongStackTrace: true});
}
}