From b5d14c26d25c4f60b89681d4d88f4f081b0828e8 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Fri, 27 May 2016 09:16:46 -0700 Subject: [PATCH] chore(lint): enable requireInternalWithUnderscore tslint check --- modules/@angular/compiler/src/animation/animation_compiler.ts | 2 ++ modules/@angular/compiler/src/template_parser.ts | 1 + modules/@angular/compiler_cli/src/codegen.ts | 2 ++ modules/@angular/core/private_export.ts | 4 ++-- modules/@angular/core/src/animation/animation_player.ts | 2 ++ modules/@angular/core/testing/testing_internal.ts | 1 + modules/@angular/facade/src/async.ts | 1 + tslint.json | 1 + 8 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/@angular/compiler/src/animation/animation_compiler.ts b/modules/@angular/compiler/src/animation/animation_compiler.ts index c516fe518b..fc8cc3d0ca 100644 --- a/modules/@angular/compiler/src/animation/animation_compiler.ts +++ b/modules/@angular/compiler/src/animation/animation_compiler.ts @@ -123,6 +123,7 @@ class _AnimationBuilder implements AnimationAstVisitor { return this._callAnimateMethod(ast, startingStylesExpr, o.literalArr(keyframeExpressions)); } + /** @internal */ _visitEndStateAnimation(ast: AnimationStepAst, context: _AnimationBuilderContext): o.Expression { var startingStylesExpr = ast.startingStyles.visit(this, context); @@ -136,6 +137,7 @@ class _AnimationBuilder implements AnimationAstVisitor { return this._callAnimateMethod(ast, startingStylesExpr, keyframesExpr); } + /** @internal */ _callAnimateMethod(ast: AnimationStepAst, startingStylesExpr, keyframesExpr) { return _ANIMATION_FACTORY_RENDERER_VAR.callMethod('animate', [ _ANIMATION_FACTORY_ELEMENT_VAR, diff --git a/modules/@angular/compiler/src/template_parser.ts b/modules/@angular/compiler/src/template_parser.ts index c01bbea4c1..1da5dcedec 100644 --- a/modules/@angular/compiler/src/template_parser.ts +++ b/modules/@angular/compiler/src/template_parser.ts @@ -168,6 +168,7 @@ export class TemplateParser { return new TemplateParseResult(result, errors); } + /** @internal */ _assertNoReferenceDuplicationOnTemplate(result:any[], errors:TemplateParseError[]):void { const existingReferences = []; result diff --git a/modules/@angular/compiler_cli/src/codegen.ts b/modules/@angular/compiler_cli/src/codegen.ts index 2985f6c047..cfd364a050 100644 --- a/modules/@angular/compiler_cli/src/codegen.ts +++ b/modules/@angular/compiler_cli/src/codegen.ts @@ -33,6 +33,8 @@ const PREAMBLE = `/** * This file is generated by the Angular 2 template compiler. * Do not edit. */ + /* tslint:disable */ + `; export class CodeGenerator { diff --git a/modules/@angular/core/private_export.ts b/modules/@angular/core/private_export.ts index ae09b621f3..1df2965233 100644 --- a/modules/@angular/core/private_export.ts +++ b/modules/@angular/core/private_export.ts @@ -21,8 +21,8 @@ import * as provider_util from './src/di/provider_util'; import * as console from './src/console'; import {Provider} from './index'; import * as reflection from './src/reflection/reflection'; -// tslint:disable-next-line -import {Reflector} from './src/reflection/reflection'; +// We need to import this name separately from the above wildcard, because this symbol is exposed. +import {Reflector} from './src/reflection/reflection'; // tslint:disable-line import { NoOpAnimationPlayer as NoOpAnimationPlayer_, diff --git a/modules/@angular/core/src/animation/animation_player.ts b/modules/@angular/core/src/animation/animation_player.ts index defee5aaea..a3f2e9301f 100644 --- a/modules/@angular/core/src/animation/animation_player.ts +++ b/modules/@angular/core/src/animation/animation_player.ts @@ -16,11 +16,13 @@ export abstract class AnimationPlayer { } export class NoOpAnimationPlayer implements AnimationPlayer { + private _subscriptions = []; public parentPlayer: AnimationPlayer = null; constructor() { scheduleMicroTask(() => this._onFinish()); } + /** @internal */ _onFinish() { this._subscriptions.forEach(entry => { entry(); }); this._subscriptions = []; diff --git a/modules/@angular/core/testing/testing_internal.ts b/modules/@angular/core/testing/testing_internal.ts index 173d2c5698..cb7e312502 100644 --- a/modules/@angular/core/testing/testing_internal.ts +++ b/modules/@angular/core/testing/testing_internal.ts @@ -212,6 +212,7 @@ export class SpyObject { return object; } + /** @internal */ _createGuinnessCompatibleSpy(name): GuinessCompatibleSpy { var newSpy: GuinessCompatibleSpy = jasmine.createSpy(name); newSpy.andCallFake = newSpy.and.callFake; diff --git a/modules/@angular/facade/src/async.ts b/modules/@angular/facade/src/async.ts index ce738c1547..1c2550d2b6 100644 --- a/modules/@angular/facade/src/async.ts +++ b/modules/@angular/facade/src/async.ts @@ -109,6 +109,7 @@ export class EventEmitter extends Subject { // we can't mark it as internal now because EventEmitter exported via @angular/core would not // contain this property making it incompatible with all the code that uses EventEmitter via // facades, which are local to the code and do not have this property stripped. + // tslint:disable-next-line __isAsync: boolean; /** diff --git a/tslint.json b/tslint.json index 481bf43a40..40fc1b87aa 100644 --- a/tslint.json +++ b/tslint.json @@ -1,5 +1,6 @@ { "rules": { + "requireInternalWithUnderscore": true, "duplicateModuleImport": true, "semicolon": true, "variable-name": false