From 17b9714ed58400c40075e3cd09cbccb0bdee5780 Mon Sep 17 00:00:00 2001 From: Adam Gordon Date: Wed, 1 Feb 2017 21:17:50 -0800 Subject: [PATCH] (core): upgrade core libs and fix resulting issues * updated core configuration for Typescript and linting and fixed errors resulting from upgrade and rules enacted. --- .eslintignore | 1 - .eslintrc | 10 ++++-- .../cache/cacheConfigurer.service.ts | 4 +-- .../appengineEditLoadBalancerStage.ts | 8 ++--- .../editLoadBalancerStage.html | 2 +- .../loadBalancerChoice.modal.controller.ts | 4 +-- .../serverGroupCommandBuilder.service.ts | 4 +-- .../wizard/cloneServerGroup.controller.ts | 6 ++-- .../application/application.model.spec.ts | 2 +- ...pplicationProviderFields.component.spec.js | 1 - ...icationNameValidationMessages.component.ts | 2 +- .../validateApplicationName.directive.ts | 4 +-- .../service/application.read.service.spec.ts | 2 +- .../service/application.write.service.ts | 5 ++- .../chaosMonkeyExceptions.component.ts | 4 +-- ...aosMonkeyNewApplicationConfig.component.ts | 2 +- .../executionDetailsSection.service.ts | 3 +- app/scripts/modules/core/domain/IExecution.ts | 1 - .../entityTag/addEntityTagLinks.component.ts | 7 ++-- .../entityTag/entityTags.write.service.ts | 4 +-- .../core/filterModel/filter.model.service.js | 2 +- .../core/history/recentHistory.service.ts | 4 +-- .../modal/wizard/v2modalWizard.component.ts | 4 +-- .../modules/core/navigation/state.provider.ts | 7 ++-- .../config/services/pipelineConfig.service.ts | 2 +- .../pipelineConfig.validator.spec.ts | 4 +-- .../validation/pipelineConfig.validator.ts | 12 ++----- .../serviceAccountAccess.validator.ts | 4 +-- .../validation/stageBeforeType.validator.ts | 2 +- .../stageOrTriggerBeforeType.validator.ts | 2 +- .../validation/targetImpedance.validator.ts | 2 +- .../autoScroll/autoScroll.directive.ts | 4 +-- .../pageNavigator.component.spec.ts | 2 +- .../serverGroupCommandBuilder.service.ts | 4 +-- .../serverGroupWarningMessage.service.ts | 5 --- .../metrics/cloudMetrics.read.service.ts | 4 +-- .../core/subnet/subnet.read.service.ts | 4 +-- .../loadBalancerSelector.directive.spec.js | 1 - .../fastProperties/domain/acaTaskStage.ts | 4 +-- .../fastProperties/domain/canary.domain.ts | 2 +- .../domain/manualJudgementStage.ts | 4 +-- .../domain/propertyStrategy.domain.ts | 6 ++-- .../fastPropertyScopeSearch.component.ts | 8 ++--- ...fastPropertyScopeSearchCategory.service.ts | 2 +- .../wizard/monitor/propertyMonitorService.ts | 8 ----- .../propertyScope/propertyScope.component.ts | 10 ------ .../propertyScopeReadOnly.componet.ts | 6 ++-- .../details/details.controller.spec.js | 2 -- .../titusMigrationConfig.component.ts | 4 +-- package.json | 33 ++++++++++--------- tsconfig.json | 15 ++------- webpack.common.js | 21 ++++++------ 52 files changed, 105 insertions(+), 165 deletions(-) delete mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 7559d4250fd..00000000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -bower_components/ \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 89c9eb71cf9..1cce6872f3f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,7 +7,7 @@ "rules": { "eol-last": 1, "semi": 2, - "quotes": [1, "single"], + "quotes": [1, "single", { "allowTemplateLiterals": true }], "comma-dangle": 0, "no-extra-boolean-cast": 1, "no-unused-vars": 1, @@ -22,7 +22,7 @@ "no-underscore-dangle": 1, "no-shadow": 0, // TODO "no-unexpected-multiline": 1, - "consistent-return": 1, + "consistent-return": 0, // ANG, shutting this off for now....it's a bit chatty "no-extend-native": 1, "space-before-blocks": 1, "semi-spacing": 1, @@ -32,6 +32,12 @@ "operator-assignment": [1, "always"], "no-const-assign": 1, "no-console": 1, + "no-control-regex": 0, + "no-case-declarations": 0, + "no-empty-pattern": 0 + }, + "parserOptions": { + "sourceType": "module" }, "env": { "browser": true, diff --git a/app/scripts/modules/appengine/cache/cacheConfigurer.service.ts b/app/scripts/modules/appengine/cache/cacheConfigurer.service.ts index 0541b28ee27..166858d3e5f 100644 --- a/app/scripts/modules/appengine/cache/cacheConfigurer.service.ts +++ b/app/scripts/modules/appengine/cache/cacheConfigurer.service.ts @@ -17,9 +17,9 @@ class AppengineCacheConfigurer { initializers: [(): ng.IPromise => this.loadBalancerReader.listLoadBalancers('appengine')] }; - static get $inject() { return ['$q', 'accountService', 'loadBalancerReader']; } + static get $inject() { return ['accountService', 'loadBalancerReader']; } - constructor(private $q: ng.IQService, private accountService: AccountService, private loadBalancerReader: any) { } + constructor(private accountService: AccountService, private loadBalancerReader: any) { } } export const APPENGINE_CACHE_CONFIGURER = 'spinnaker.appengine.cacheConfigurer.service'; diff --git a/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.ts b/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.ts index f7eac8d9a75..ac845450f92 100644 --- a/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.ts +++ b/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.ts @@ -3,17 +3,15 @@ import {IModalService} from 'angular-ui-bootstrap'; import {cloneDeep, get} from 'lodash'; import {CloudProviderRegistry} from 'core/cloudProvider/cloudProvider.registry'; -import {LoadBalancerReader} from 'core/loadBalancer/loadBalancer.read.service'; import {ILoadBalancer} from 'core/domain/index'; import {APPENGINE_LOAD_BALANCER_CHOICE_MODAL_CTRL} from './loadBalancerChoice.modal.controller'; class AppengineEditLoadBalancerStageCtrl { - static get $inject() { return ['$scope', '$uibModal', 'cloudProviderRegistry', 'loadBalancerReader']; } + static get $inject() { return ['$scope', '$uibModal', 'cloudProviderRegistry']; } constructor(public $scope: any, private $uibModal: IModalService, - private cloudProviderRegistry: CloudProviderRegistry, - private loadBalancerReader: LoadBalancerReader) { + private cloudProviderRegistry: CloudProviderRegistry) { $scope.stage.loadBalancers = $scope.stage.loadBalancers || []; $scope.stage.cloudProvider = 'appengine'; } @@ -30,7 +28,7 @@ class AppengineEditLoadBalancerStageCtrl { }); } - public editLoadBalancer(loadBalancer: ILoadBalancer, index: number) { + public editLoadBalancer(index: number) { let config = this.cloudProviderRegistry.getValue('appengine', 'loadBalancer'); this.$uibModal.open({ templateUrl: config.createLoadBalancerTemplateUrl, diff --git a/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/editLoadBalancerStage.html b/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/editLoadBalancerStage.html index b455bf61340..d70612e4eff 100644 --- a/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/editLoadBalancerStage.html +++ b/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/editLoadBalancerStage.html @@ -27,7 +27,7 @@

Load Balancers

{{ loadBalancer.region }} - + diff --git a/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.ts b/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.ts index 90fc4580fe3..5df9d6db149 100644 --- a/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.ts +++ b/app/scripts/modules/appengine/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.ts @@ -2,7 +2,6 @@ import {module} from 'angular'; import {IModalService, IModalServiceInstance} from 'angular-ui-bootstrap'; import {cloneDeep} from 'lodash'; -import {LoadBalancerReader} from 'core/loadBalancer/loadBalancer.read.service'; import {CloudProviderRegistry} from 'core/cloudProvider/cloudProvider.registry'; import {Application} from 'core/application/application.model'; import {ILoadBalancer} from 'core/domain/loadBalancer'; @@ -12,12 +11,11 @@ class AppengineLoadBalancerChoiceModalCtrl { public loadBalancers: ILoadBalancer[]; public selectedLoadBalancer: ILoadBalancer; - static get $inject() { return ['$uibModal', '$uibModalInstance', 'application', 'loadBalancerReader', 'cloudProviderRegistry']; } + static get $inject() { return ['$uibModal', '$uibModalInstance', 'application', 'cloudProviderRegistry']; } constructor(private $uibModal: IModalService, private $uibModalInstance: IModalServiceInstance, private application: Application, - private loadBalancerReader: LoadBalancerReader, private cloudProviderRegistry: CloudProviderRegistry) { this.initialize(); } diff --git a/app/scripts/modules/appengine/serverGroup/configure/serverGroupCommandBuilder.service.ts b/app/scripts/modules/appengine/serverGroup/configure/serverGroupCommandBuilder.service.ts index e3122ad2c89..4dd2a40e0c6 100644 --- a/app/scripts/modules/appengine/serverGroup/configure/serverGroupCommandBuilder.service.ts +++ b/app/scripts/modules/appengine/serverGroup/configure/serverGroupCommandBuilder.service.ts @@ -82,7 +82,7 @@ export class AppengineServerGroupCommandBuilder { }); } - public buildNewServerGroupCommandForPipeline(stage: IStage, pipeline: IPipeline): {backingData: {triggerOptions: Array}} { + public buildNewServerGroupCommandForPipeline(_stage: IStage, pipeline: IPipeline): {backingData: {triggerOptions: Array}} { // We can't copy server group configuration for App Engine, and can't build the full command here because we don't have // access to the application. return {backingData: {triggerOptions: AppengineServerGroupCommandBuilder.getTriggerOptions(pipeline)}}; @@ -90,7 +90,7 @@ export class AppengineServerGroupCommandBuilder { public buildServerGroupCommandFromPipeline(app: Application, cluster: AppengineDeployDescription, - stage: IStage, + _stage: IStage, pipeline: IPipeline): ng.IPromise { return this.buildNewServerGroupCommand(app, 'appengine', 'editPipeline') .then((command: IAppengineServerGroupCommand) => { diff --git a/app/scripts/modules/appengine/serverGroup/configure/wizard/cloneServerGroup.controller.ts b/app/scripts/modules/appengine/serverGroup/configure/wizard/cloneServerGroup.controller.ts index 7e3bc740d6d..73bced2a0f9 100644 --- a/app/scripts/modules/appengine/serverGroup/configure/wizard/cloneServerGroup.controller.ts +++ b/app/scripts/modules/appengine/serverGroup/configure/wizard/cloneServerGroup.controller.ts @@ -21,7 +21,6 @@ class AppengineCloneServerGroupCtrl { static get $inject() { return ['$scope', '$uibModalInstance', - 'title', 'serverGroupCommand', 'application', 'taskMonitorBuilder', @@ -30,12 +29,11 @@ class AppengineCloneServerGroupCtrl { constructor(public $scope: any, private $uibModalInstance: any, - private title: string, public serverGroupCommand: IAppengineServerGroupCommand, private application: Application, - private taskMonitorBuilder: TaskMonitorBuilder, + taskMonitorBuilder: TaskMonitorBuilder, private serverGroupWriter: ServerGroupWriter, - private commandBuilder: AppengineServerGroupCommandBuilder) { + commandBuilder: AppengineServerGroupCommandBuilder) { if (['create', 'editPipeline'].includes(get(serverGroupCommand, 'viewState.mode'))) { $scope.command = serverGroupCommand; diff --git a/app/scripts/modules/core/application/application.model.spec.ts b/app/scripts/modules/core/application/application.model.spec.ts index db2dfdcc36a..fe0427d102e 100644 --- a/app/scripts/modules/core/application/application.model.spec.ts +++ b/app/scripts/modules/core/application/application.model.spec.ts @@ -50,7 +50,7 @@ describe ('Application Model', function () { spyOn(loadBalancerReader, 'loadLoadBalancers').and.returnValue($q.when(loadBalancers)); spyOn(clusterService, 'loadServerGroups').and.returnValue($q.when(serverGroups)); spyOn(securityGroupReader, 'loadSecurityGroups').and.returnValue($q.when([])); - spyOn(securityGroupReader, 'getApplicationSecurityGroups').and.callFake(function(app: Application, groupsByName: any[]) { + spyOn(securityGroupReader, 'getApplicationSecurityGroups').and.callFake(function(_app: Application, groupsByName: any[]) { return $q.when(groupsByName || []); }); application = applicationModelBuilder.createApplication(applicationDataSourceRegistry.getDataSources()); diff --git a/app/scripts/modules/core/application/modal/applicationProviderFields.component.spec.js b/app/scripts/modules/core/application/modal/applicationProviderFields.component.spec.js index f500f72710c..b87e02bfb07 100644 --- a/app/scripts/modules/core/application/modal/applicationProviderFields.component.spec.js +++ b/app/scripts/modules/core/application/modal/applicationProviderFields.component.spec.js @@ -6,7 +6,6 @@ describe('Controller: ApplicationProviderFieldsCtrl', function () { scope, cloudProviderRegistry, settings, - angular = require('angular'), _ = require('lodash'); beforeEach( diff --git a/app/scripts/modules/core/application/modal/validation/applicationNameValidationMessages.component.ts b/app/scripts/modules/core/application/modal/validation/applicationNameValidationMessages.component.ts index 86a7792c4bf..c20f2487426 100644 --- a/app/scripts/modules/core/application/modal/validation/applicationNameValidationMessages.component.ts +++ b/app/scripts/modules/core/application/modal/validation/applicationNameValidationMessages.component.ts @@ -17,7 +17,7 @@ class ApplicationNameValidationMessagesController implements ng.IComponentContro public constructor(private applicationNameValidator: ApplicationNameValidator) {} - public $onChanges(changes: ng.IOnChangesObject): void { + public $onChanges(): void { this.applicationNameValidator.validate(this.name, this.cloudProviders).then(r => this.messages = r); } } diff --git a/app/scripts/modules/core/application/modal/validation/validateApplicationName.directive.ts b/app/scripts/modules/core/application/modal/validation/validateApplicationName.directive.ts index 5b95e2fbb51..9bdaff0f249 100644 --- a/app/scripts/modules/core/application/modal/validation/validateApplicationName.directive.ts +++ b/app/scripts/modules/core/application/modal/validation/validateApplicationName.directive.ts @@ -1,5 +1,5 @@ import {module} from 'angular'; -import { DirectiveFactory } from '../../../utils/tsDecorators/directiveFactoryDecorator'; +import { DirectiveFactory } from 'core/utils/tsDecorators/directiveFactoryDecorator'; import { APPLICATION_NAME_VALIDATOR, ApplicationNameValidator, IApplicationNameValidationResult @@ -52,7 +52,7 @@ class ValidateApplicationNameDirective implements ng.IDirective { cloudProviders: '<', }; - link($scope: ng.IScope, $element: JQuery, $attrs: IValidateNameAttrs, ctrl: ng.INgModelController) { + link($scope: ng.IScope, _$element: JQuery, $attrs: IValidateNameAttrs, ctrl: ng.INgModelController) { const $ctrl: ValidateApplicationNameController = $scope['$ctrl']; $ctrl.$scope = $scope; $ctrl.$attrs = $attrs; diff --git a/app/scripts/modules/core/application/service/application.read.service.spec.ts b/app/scripts/modules/core/application/service/application.read.service.spec.ts index 06544615cd9..647d1efaad6 100644 --- a/app/scripts/modules/core/application/service/application.read.service.spec.ts +++ b/app/scripts/modules/core/application/service/application.read.service.spec.ts @@ -61,7 +61,7 @@ describe('Service: applicationReader', function () { spyOn(loadBalancerReader, 'loadLoadBalancers').and.returnValue($q.when([])); spyOn(clusterService, 'loadServerGroups').and.returnValue($q.when([])); spyOn(securityGroupReader, 'loadSecurityGroups').and.returnValue($q.when([])); - spyOn(securityGroupReader, 'getApplicationSecurityGroups').and.callFake(function(app: Application, groupsByName: any) { + spyOn(securityGroupReader, 'getApplicationSecurityGroups').and.callFake(function(_app: Application, groupsByName: any) { return $q.when(groupsByName || []); }); diff --git a/app/scripts/modules/core/application/service/application.write.service.ts b/app/scripts/modules/core/application/service/application.write.service.ts index 455c74c0fea..30b8cfc72bc 100644 --- a/app/scripts/modules/core/application/service/application.write.service.ts +++ b/app/scripts/modules/core/application/service/application.write.service.ts @@ -14,10 +14,9 @@ export interface IApplicationAttributes { export class ApplicationWriter { - static get $inject() { return ['$q', 'taskExecutor', 'recentHistoryService']; } + static get $inject() { return ['taskExecutor', 'recentHistoryService']; } - public constructor(private $q: ng.IQService, - private taskExecutor: TaskExecutor, + public constructor(private taskExecutor: TaskExecutor, private recentHistoryService: RecentHistoryService) {} public createApplication(application: IApplicationAttributes): ng.IPromise { diff --git a/app/scripts/modules/core/chaosMonkey/chaosMonkeyExceptions.component.ts b/app/scripts/modules/core/chaosMonkey/chaosMonkeyExceptions.component.ts index 4aa5b950562..55e4e046a18 100644 --- a/app/scripts/modules/core/chaosMonkey/chaosMonkeyExceptions.component.ts +++ b/app/scripts/modules/core/chaosMonkey/chaosMonkeyExceptions.component.ts @@ -8,14 +8,14 @@ import './chaosMonkeyExceptions.component.less'; export class ChaosMonkeyExceptionsController { - static get $inject() { return ['accountService', '$q']; } + static get $inject() { return ['accountService']; } public accounts: IAccountDetails[] = []; public regionsByAccount: any; public config: any; public configChanged: () => void; - public constructor(private accountService: AccountService, private $q: ng.IQService) {} + public constructor(private accountService: AccountService) {} public addException(): void { this.config.exceptions = this.config.exceptions || []; diff --git a/app/scripts/modules/core/chaosMonkey/chaosMonkeyNewApplicationConfig.component.ts b/app/scripts/modules/core/chaosMonkey/chaosMonkeyNewApplicationConfig.component.ts index dabd1a83c89..38d9f06e33e 100644 --- a/app/scripts/modules/core/chaosMonkey/chaosMonkeyNewApplicationConfig.component.ts +++ b/app/scripts/modules/core/chaosMonkey/chaosMonkeyNewApplicationConfig.component.ts @@ -7,7 +7,7 @@ export class ChaosMonkeyNewApplicationConfigController { public enabled: boolean = false; public applicationConfig: any; - public constructor(private settings: any) { + public constructor(settings: any) { this.enabled = settings.feature && settings.feature.chaosMonkey; if (this.enabled) { this.applicationConfig.chaosMonkey = { diff --git a/app/scripts/modules/core/delivery/details/executionDetailsSection.service.ts b/app/scripts/modules/core/delivery/details/executionDetailsSection.service.ts index 5b8fd911cfe..960500ee27d 100644 --- a/app/scripts/modules/core/delivery/details/executionDetailsSection.service.ts +++ b/app/scripts/modules/core/delivery/details/executionDetailsSection.service.ts @@ -5,11 +5,10 @@ export class ExecutionDetailsSectionService { private pendingOnComplete: ng.IPromise; - static get $inject() { return ['$stateParams', '$state', '$q', '$timeout']; } + static get $inject() { return ['$stateParams', '$state', '$timeout']; } public constructor(private $stateParams: IExecutionDetailsStateParams, private $state: angular.ui.IStateService, - private $q: ng.IQService, private $timeout: ng.ITimeoutService) {} private sectionIsValid(availableSections: string[]): boolean { diff --git a/app/scripts/modules/core/domain/IExecution.ts b/app/scripts/modules/core/domain/IExecution.ts index ceb260136b4..cbd7764c54a 100644 --- a/app/scripts/modules/core/domain/IExecution.ts +++ b/app/scripts/modules/core/domain/IExecution.ts @@ -1,5 +1,4 @@ import {IOrchestratedItem} from './IOrchestratedItem'; -import {ITrigger} from './ITrigger'; import {IExecutionTrigger} from './IExecutionTrigger'; import {IExecutionStage} from './IExecutionStage'; diff --git a/app/scripts/modules/core/entityTag/addEntityTagLinks.component.ts b/app/scripts/modules/core/entityTag/addEntityTagLinks.component.ts index 06bc910df19..5629cc47d3f 100644 --- a/app/scripts/modules/core/entityTag/addEntityTagLinks.component.ts +++ b/app/scripts/modules/core/entityTag/addEntityTagLinks.component.ts @@ -6,7 +6,6 @@ import {IEntityRef} from 'core/domain/IEntityTags'; import {ENTITY_TAG_EDITOR_CTRL, EntityTagEditorCtrl, IOwnerOption} from './entityTagEditor.controller'; import {ENTITY_TAGS_HELP} from './entityTags.help'; import {Application} from 'core/application/application.model'; -import {ENTITY_TAG_WRITER, EntityTagWriter} from './entityTags.write.service'; import './entityTagDetails.component.less'; @@ -19,10 +18,9 @@ class AddEntityTagLinksCtrl implements ng.IComponentController { private onUpdate: () => any; private ownerOptions: IOwnerOption[]; - static get $inject() { return ['$uibModal', 'confirmationModalService', 'entityTagWriter']; } + static get $inject() { return ['$uibModal']; } - public constructor(private $uibModal: IModalService, private confirmationModalService: any, - private entityTagWriter: EntityTagWriter) {} + public constructor(private $uibModal: IModalService) {} public addTag(tagType: string): void { this.$uibModal.open({ @@ -79,7 +77,6 @@ class AddEntityTagLinksComponent implements ng.IComponentOptions { export const ADD_ENTITY_TAG_LINKS_COMPONENT = 'spinnaker.core.entityTag.details.component'; module(ADD_ENTITY_TAG_LINKS_COMPONENT, [ ENTITY_TAG_EDITOR_CTRL, - ENTITY_TAG_WRITER, ENTITY_TAGS_HELP ]) .component('addEntityTagLinks', new AddEntityTagLinksComponent()); diff --git a/app/scripts/modules/core/entityTag/entityTags.write.service.ts b/app/scripts/modules/core/entityTag/entityTags.write.service.ts index 8263c6dada4..0c1ec24f726 100644 --- a/app/scripts/modules/core/entityTag/entityTags.write.service.ts +++ b/app/scripts/modules/core/entityTag/entityTags.write.service.ts @@ -5,9 +5,9 @@ import {IEntityRef, IEntityTags, IEntityTag} from '../domain/IEntityTags'; export class EntityTagWriter { - static get $inject() { return ['$q', 'taskExecutor']; } + static get $inject() { return ['taskExecutor']; } - public constructor(private $q: ng.IQService, private taskExecutor: TaskExecutor) {} + public constructor(private taskExecutor: TaskExecutor) {} public upsertEntityTag(application: Application, tag: IEntityTag, entityRef: IEntityRef, isNew: boolean): ng.IPromise { return this.taskExecutor.executeTask({ diff --git a/app/scripts/modules/core/filterModel/filter.model.service.js b/app/scripts/modules/core/filterModel/filter.model.service.js index 654b71cd6bb..93442b8b41c 100644 --- a/app/scripts/modules/core/filterModel/filter.model.service.js +++ b/app/scripts/modules/core/filterModel/filter.model.service.js @@ -198,7 +198,7 @@ module.exports = angular }, toModel: function(filterModel, property) { var val = getParamVal(property); - return !Boolean(val); + return !val; } }, 'number': { diff --git a/app/scripts/modules/core/history/recentHistory.service.ts b/app/scripts/modules/core/history/recentHistory.service.ts index 31aa9bcfede..f3cc11aaafa 100644 --- a/app/scripts/modules/core/history/recentHistory.service.ts +++ b/app/scripts/modules/core/history/recentHistory.service.ts @@ -30,7 +30,7 @@ export class RecentHistoryService { static get $inject() { return ['deckCacheFactory']; } - constructor(private deckCacheFactory: DeckCacheService) { + constructor(deckCacheFactory: DeckCacheService) { deckCacheFactory.createCache('history', 'user', { version: 3, maxAge: moment.duration(90, 'days').asMilliseconds(), @@ -136,7 +136,7 @@ module(RECENT_HISTORY_SERVICE, [ DECK_CACHE_SERVICE, ]).service('recentHistoryService', RecentHistoryService) .run(($rootScope: ng.IRootScopeService, recentHistoryService: RecentHistoryService) => { - $rootScope.$on('$stateChangeSuccess', (event: IAngularEvent, toState: IState, toParams: any) => { + $rootScope.$on('$stateChangeSuccess', (_event: IAngularEvent, toState: IState, toParams: any) => { if (toState.data && toState.data.history) { recentHistoryService.addItem(toState.data.history.type, toState.name, toParams, toState.data.history.keyParams); } diff --git a/app/scripts/modules/core/modal/wizard/v2modalWizard.component.ts b/app/scripts/modules/core/modal/wizard/v2modalWizard.component.ts index f73c6b6d0c8..ae53b7a016e 100644 --- a/app/scripts/modules/core/modal/wizard/v2modalWizard.component.ts +++ b/app/scripts/modules/core/modal/wizard/v2modalWizard.component.ts @@ -12,12 +12,12 @@ export class V2ModalWizard implements ng.IComponentController { public taskMonitor: any; public dismiss: () => any; - public constructor(private $scope: ng.IScope, private v2modalWizardService: any) { + public constructor(private $scope: ng.IScope, v2modalWizardService: any) { this.wizard = v2modalWizardService; } public $onInit() { - this.$scope.$on('waypoints-changed', (event: any, snapshot: any) => { + this.$scope.$on('waypoints-changed', (_event: any, snapshot: any) => { let ids = snapshot.lastWindow .map((entry: any) => entry.elem) .filter((key: string) => this.wizard.getPage(key)); diff --git a/app/scripts/modules/core/navigation/state.provider.ts b/app/scripts/modules/core/navigation/state.provider.ts index e7fed9ac605..3ea8cc70f50 100644 --- a/app/scripts/modules/core/navigation/state.provider.ts +++ b/app/scripts/modules/core/navigation/state.provider.ts @@ -1,5 +1,5 @@ import {module} from 'angular'; -import {IStateProvider, IUrlRouterProvider, IState} from 'angular-ui-router'; +import {IUrlRouterProvider, IState} from 'angular-ui-router'; import {STATE_HELPER, StateHelper} from './stateHelper.provider'; require('./navigation.less'); @@ -16,10 +16,9 @@ export class StateConfigProvider implements ng.IServiceProvider { children: [], }; - static get $inject() { return ['$stateProvider', '$urlRouterProvider', 'stateHelperProvider']; } + static get $inject() { return ['$urlRouterProvider', 'stateHelperProvider']; } - constructor(private $stateProvider: IStateProvider, - private $urlRouterProvider: IUrlRouterProvider, + constructor(private $urlRouterProvider: IUrlRouterProvider, private stateHelperProvider: StateHelper) {} /** diff --git a/app/scripts/modules/core/pipeline/config/services/pipelineConfig.service.ts b/app/scripts/modules/core/pipeline/config/services/pipelineConfig.service.ts index e34a9119cf5..3c7b971dbbf 100644 --- a/app/scripts/modules/core/pipeline/config/services/pipelineConfig.service.ts +++ b/app/scripts/modules/core/pipeline/config/services/pipelineConfig.service.ts @@ -17,7 +17,7 @@ export class PipelineConfigService { public constructor(private $q: ng.IQService, private API: Api, private authenticationService: AuthenticationService, - private viewStateCache: ViewStateCacheService) { + viewStateCache: ViewStateCacheService) { this.configViewStateCache = viewStateCache.createCache('pipelineConfig', { version: 1 }); } diff --git a/app/scripts/modules/core/pipeline/config/validation/pipelineConfig.validator.spec.ts b/app/scripts/modules/core/pipeline/config/validation/pipelineConfig.validator.spec.ts index 5e6db68629d..25f4eb14521 100644 --- a/app/scripts/modules/core/pipeline/config/validation/pipelineConfig.validator.spec.ts +++ b/app/scripts/modules/core/pipeline/config/validation/pipelineConfig.validator.spec.ts @@ -861,7 +861,7 @@ describe('pipelineConfigValidator', () => { validationCalled = true; return 'did not skip'; }, - skipValidation: (p: IPipeline, stage: IStage): boolean => { + skipValidation: (_p: IPipeline, stage: IStage): boolean => { return stage.name === 'skip'; } } as ICustomValidator @@ -892,7 +892,7 @@ describe('pipelineConfigValidator', () => { return buildStageTypeConfig([ { type: 'custom', - validate: (p: IPipeline, s: IStage): string => { + validate: (_p: IPipeline, s: IStage): string => { if (s.name.includes(' ')) { return 'No spaces in targetCheck stage names'; } diff --git a/app/scripts/modules/core/pipeline/config/validation/pipelineConfig.validator.ts b/app/scripts/modules/core/pipeline/config/validation/pipelineConfig.validator.ts index 64c5884d255..4f702322e35 100644 --- a/app/scripts/modules/core/pipeline/config/validation/pipelineConfig.validator.ts +++ b/app/scripts/modules/core/pipeline/config/validation/pipelineConfig.validator.ts @@ -1,7 +1,6 @@ import {module} from 'angular'; import {Subject} from 'rxjs'; -import {PIPELINE_CONFIG_SERVICE, PipelineConfigService} from 'core/pipeline/config/services/pipelineConfig.service'; import {IStage} from 'core/domain/IStage'; import {IPipeline} from 'core/domain/IPipeline'; import {ITrigger} from 'core/domain/ITrigger'; @@ -28,11 +27,6 @@ export interface ITriggerTypeConfig extends IStageOrTriggerTypeConfig { manualExecutionHandler?: string; } -export interface IStrategyStageTypeConfig extends IStageTypeConfig { - strategyDescription: string; - strategy: boolean; -} - export interface IStageTypeConfig extends IStageOrTriggerTypeConfig { defaultTimeoutMs?: number; } @@ -69,12 +63,11 @@ export class PipelineConfigValidator implements ng.IServiceProvider { this.validators.set(type, validator); } - static get $inject() { return ['$log', '$q', 'pipelineConfig', 'pipelineConfigService']; } + static get $inject() { return ['$log', '$q', 'pipelineConfig']; } constructor(private $log: ng.ILogService, private $q: ng.IQService, - private pipelineConfig: any, - private pipelineConfigService: PipelineConfigService) {} + private pipelineConfig: any) {} public validatePipeline(pipeline: IPipeline): ng.IPromise { const stages: IStage[] = pipeline.stages || [], @@ -186,7 +179,6 @@ export class PipelineConfigValidator implements ng.IServiceProvider { export const PIPELINE_CONFIG_VALIDATOR = 'spinnaker.core.pipeline.config.validator'; module(PIPELINE_CONFIG_VALIDATOR, [ require('../pipelineConfigProvider.js'), - PIPELINE_CONFIG_SERVICE, ]).service('pipelineConfigValidator', PipelineConfigValidator) .run((pipelineConfigValidator: PipelineConfigValidator) => { // placeholder - custom validators must implement the ICustomValidator interface diff --git a/app/scripts/modules/core/pipeline/config/validation/serviceAccountAccess.validator.ts b/app/scripts/modules/core/pipeline/config/validation/serviceAccountAccess.validator.ts index 74283ed1179..be838da1742 100644 --- a/app/scripts/modules/core/pipeline/config/validation/serviceAccountAccess.validator.ts +++ b/app/scripts/modules/core/pipeline/config/validation/serviceAccountAccess.validator.ts @@ -22,10 +22,10 @@ export class ServiceAccountAccessValidator implements IStageOrTriggerValidator { constructor(private serviceAccountService: ServiceAccountService, private settings: any) {} - public validate(pipeline: IPipeline, + public validate(_pipeline: IPipeline, stage: ITriggerWithServiceAccount, validator: IServiceAccountAccessValidationConfig, - config: IStageOrTriggerTypeConfig): ng.IPromise { + _config: IStageOrTriggerTypeConfig): ng.IPromise { if (this.settings.feature.fiatEnabled) { return this.serviceAccountService.getServiceAccounts() diff --git a/app/scripts/modules/core/pipeline/config/validation/stageBeforeType.validator.ts b/app/scripts/modules/core/pipeline/config/validation/stageBeforeType.validator.ts index 4e10a3a73bf..b8232be4ebc 100644 --- a/app/scripts/modules/core/pipeline/config/validation/stageBeforeType.validator.ts +++ b/app/scripts/modules/core/pipeline/config/validation/stageBeforeType.validator.ts @@ -26,7 +26,7 @@ export class StageBeforeTypeValidator implements IStageOrTriggerValidator { public validate(pipeline: IPipeline, stage: IStage, validator: IStageBeforeTypeValidationConfig, - config: IStageOrTriggerTypeConfig): string { + _config: IStageOrTriggerTypeConfig): string { if (pipeline.strategy === true && stage.type === 'deploy') { return null; diff --git a/app/scripts/modules/core/pipeline/config/validation/stageOrTriggerBeforeType.validator.ts b/app/scripts/modules/core/pipeline/config/validation/stageOrTriggerBeforeType.validator.ts index 7c4c74392d2..867310cfd01 100644 --- a/app/scripts/modules/core/pipeline/config/validation/stageOrTriggerBeforeType.validator.ts +++ b/app/scripts/modules/core/pipeline/config/validation/stageOrTriggerBeforeType.validator.ts @@ -33,7 +33,7 @@ export class StageOrTriggerBeforeTypeValidator implements IStageOrTriggerValidat public validate(pipeline: IPipeline, stage: IStage, validator: IStageOrTriggerBeforeTypeValidationConfig, - config: IStageOrTriggerTypeConfig): ng.IPromise { + _config: IStageOrTriggerTypeConfig): ng.IPromise { const stageTypes = validator.stageTypes || [validator.stageType]; const stagesToTest: (IStage | ITrigger)[] = this.pipelineConfigService.getAllUpstreamDependencies(pipeline, stage); diff --git a/app/scripts/modules/core/pipeline/config/validation/targetImpedance.validator.ts b/app/scripts/modules/core/pipeline/config/validation/targetImpedance.validator.ts index d9ee3af00ca..b7412620ec5 100644 --- a/app/scripts/modules/core/pipeline/config/validation/targetImpedance.validator.ts +++ b/app/scripts/modules/core/pipeline/config/validation/targetImpedance.validator.ts @@ -27,7 +27,7 @@ export class TargetImpedanceValidator implements IStageOrTriggerValidator { public validate(pipeline: IPipeline, stage: IStage, validator: ITargetImpedanceValidationConfig, - config: IStageOrTriggerTypeConfig): string { + _config: IStageOrTriggerTypeConfig): string { const stagesToTest: IStage[] = this.pipelineConfigService.getAllUpstreamDependencies(pipeline, stage), regions: string[] = stage['regions'] || []; diff --git a/app/scripts/modules/core/presentation/autoScroll/autoScroll.directive.ts b/app/scripts/modules/core/presentation/autoScroll/autoScroll.directive.ts index 64747e4262c..913e8870190 100644 --- a/app/scripts/modules/core/presentation/autoScroll/autoScroll.directive.ts +++ b/app/scripts/modules/core/presentation/autoScroll/autoScroll.directive.ts @@ -1,5 +1,5 @@ import {module} from 'angular'; -import { DirectiveFactory } from '../../utils/tsDecorators/directiveFactoryDecorator'; +import { DirectiveFactory } from 'core/utils/tsDecorators/directiveFactoryDecorator'; import {Subject} from 'rxjs'; interface AutoScrollAttrs { @@ -46,7 +46,7 @@ export class AutoScrollController implements ng.IComponentController { this.$scope.$on('$destroy', () => this.scrollToTop.unsubscribe()); } this.$scope.$watch(this.$attrs.autoScrollEnabled, (newVal: boolean) => this.toggleAutoScrollEnabled(newVal), true); - this.$scope.$watch(this.$attrs.autoScroll, (newVal: any[]) => this.autoScroll(), true); + this.$scope.$watch(this.$attrs.autoScroll, () => this.autoScroll(), true); this.$scope.$on('$destroy', () => this.scrollableContainer.off(this.containerEvent)); } diff --git a/app/scripts/modules/core/presentation/navigation/pageNavigator.component.spec.ts b/app/scripts/modules/core/presentation/navigation/pageNavigator.component.spec.ts index 2a051c3a9c3..02f4df94de6 100644 --- a/app/scripts/modules/core/presentation/navigation/pageNavigator.component.spec.ts +++ b/app/scripts/modules/core/presentation/navigation/pageNavigator.component.spec.ts @@ -34,7 +34,7 @@ describe('Component: Page Navigator', () => { let dom = `
`; - pages.forEach((p, index) => { + pages.forEach((_p, index) => { dom += `
diff --git a/app/scripts/modules/core/serverGroup/configure/common/serverGroupCommandBuilder.service.ts b/app/scripts/modules/core/serverGroup/configure/common/serverGroupCommandBuilder.service.ts index 5ee25da1694..93a4df0cb1b 100644 --- a/app/scripts/modules/core/serverGroup/configure/common/serverGroupCommandBuilder.service.ts +++ b/app/scripts/modules/core/serverGroup/configure/common/serverGroupCommandBuilder.service.ts @@ -11,14 +11,14 @@ export interface IServerGroupCommandBuilderOptions { export class ServerGroupCommandBuilderService { static get $inject(): string[] { - return ['settings', 'serviceDelegate']; + return ['serviceDelegate']; } private getDelegate(provider: string): any { return this.delegate.getDelegate(provider, 'serverGroup.commandBuilder'); } - constructor(private settings: any, private delegate: any) {} + constructor(private delegate: any) {} public buildNewServerGroupCommand(application: Application, provider: string, diff --git a/app/scripts/modules/core/serverGroup/details/serverGroupWarningMessage.service.ts b/app/scripts/modules/core/serverGroup/details/serverGroupWarningMessage.service.ts index 38094a0ba50..36e50edab53 100644 --- a/app/scripts/modules/core/serverGroup/details/serverGroupWarningMessage.service.ts +++ b/app/scripts/modules/core/serverGroup/details/serverGroupWarningMessage.service.ts @@ -12,11 +12,6 @@ export interface IDisableWarningContents { verificationLabel: string; } -interface IRemainingServerGroup { - label: string; - instances: number; -} - export class ServerGroupWarningMessageService { public addDestroyWarningMessage(application: Application, serverGroup: ServerGroup, params: IConfirmationModalParams): void { diff --git a/app/scripts/modules/core/serverGroup/metrics/cloudMetrics.read.service.ts b/app/scripts/modules/core/serverGroup/metrics/cloudMetrics.read.service.ts index 37b4e01a7e1..08ef9fcd28a 100644 --- a/app/scripts/modules/core/serverGroup/metrics/cloudMetrics.read.service.ts +++ b/app/scripts/modules/core/serverGroup/metrics/cloudMetrics.read.service.ts @@ -12,9 +12,9 @@ export interface ICloudMetricStatistics { export class CloudMetricsReader { - static get $inject() { return ['API', 'settings']; } + static get $inject() { return ['API']; } - public constructor(private API: Api, private settings: any) {} + public constructor(private API: Api) {} public listMetrics(provider: string, account: string, region: string, filters: any): ng.IPromise { return this.API.all('cloudMetrics').all(provider).all(account).all(region) diff --git a/app/scripts/modules/core/subnet/subnet.read.service.ts b/app/scripts/modules/core/subnet/subnet.read.service.ts index 3b052538b08..9df312d4ece 100644 --- a/app/scripts/modules/core/subnet/subnet.read.service.ts +++ b/app/scripts/modules/core/subnet/subnet.read.service.ts @@ -17,9 +17,9 @@ export class SubnetReader { private static NAMESPACE = 'subnets'; - static get $inject() { return ['$q', 'API', 'infrastructureCaches']; } + static get $inject() { return ['API', 'infrastructureCaches']; } - public constructor(private $q: ng.IQService, private API: Api, private infrastructureCaches: InfrastructureCacheService) {} + public constructor(private API: Api, private infrastructureCaches: InfrastructureCacheService) {} public listSubnets(): ng.IPromise { return this.API.one('subnets') diff --git a/app/scripts/modules/google/serverGroup/configure/wizard/loadBalancers/loadBalancerSelector.directive.spec.js b/app/scripts/modules/google/serverGroup/configure/wizard/loadBalancers/loadBalancerSelector.directive.spec.js index 85af2a702d5..4fb8ac8e744 100644 --- a/app/scripts/modules/google/serverGroup/configure/wizard/loadBalancers/loadBalancerSelector.directive.spec.js +++ b/app/scripts/modules/google/serverGroup/configure/wizard/loadBalancers/loadBalancerSelector.directive.spec.js @@ -1,6 +1,5 @@ 'use strict'; -import * as moment from 'moment'; let angular = require('angular'); require('./loadBalancerSelector.directive.html'); diff --git a/app/scripts/modules/netflix/fastProperties/domain/acaTaskStage.ts b/app/scripts/modules/netflix/fastProperties/domain/acaTaskStage.ts index c7d9741dfbe..a1122cddbe0 100644 --- a/app/scripts/modules/netflix/fastProperties/domain/acaTaskStage.ts +++ b/app/scripts/modules/netflix/fastProperties/domain/acaTaskStage.ts @@ -13,13 +13,11 @@ export class AcaTaskStage implements IStage { public comments: string; public canary: Canary; - constructor(private user: IUser, private command: PropertyCommand, private configDetails: AcaTaskStageConfigDetails, private previousStage?: IStage) { + constructor(user: IUser, command: PropertyCommand, configDetails: AcaTaskStageConfigDetails, previousStage?: IStage) { this.refId = previousStage ? `${toInteger(previousStage.refId) + 1}` : '1'; this.requisiteStageRefIds = previousStage ? [previousStage.refId] : []; this.type = 'acaTask'; this.name = 'ACA Task'; this.canary = new Canary(user, command, configDetails); } - - } diff --git a/app/scripts/modules/netflix/fastProperties/domain/canary.domain.ts b/app/scripts/modules/netflix/fastProperties/domain/canary.domain.ts index f8841f5b354..b32f10ae156 100644 --- a/app/scripts/modules/netflix/fastProperties/domain/canary.domain.ts +++ b/app/scripts/modules/netflix/fastProperties/domain/canary.domain.ts @@ -76,7 +76,7 @@ class CanaryDeployments { public canary: string; public type: string; - constructor(private canaryDeployment: ICanaryDeployment) { + constructor(canaryDeployment: ICanaryDeployment) { this.region = canaryDeployment.region; this.accountName = canaryDeployment.accountName; this.baseline = canaryDeployment.baseline; diff --git a/app/scripts/modules/netflix/fastProperties/domain/manualJudgementStage.ts b/app/scripts/modules/netflix/fastProperties/domain/manualJudgementStage.ts index 39d08ad371d..21e907b2062 100644 --- a/app/scripts/modules/netflix/fastProperties/domain/manualJudgementStage.ts +++ b/app/scripts/modules/netflix/fastProperties/domain/manualJudgementStage.ts @@ -1,6 +1,5 @@ import {toInteger} from 'lodash'; import {IStage} from 'core/domain/IStage'; -import {PropertyCommand} from './propertyCommand.model'; import {IUser} from 'core/authentication/authentication.service'; export class ManualJudgementStage implements IStage { @@ -14,8 +13,7 @@ export class ManualJudgementStage implements IStage { instructions: string = 'Is Fast Property good to move forward?'; propagateAuthenticationContext: boolean = true; - - constructor(user: IUser, command: PropertyCommand, previousStage?: IStage) { + constructor(user: IUser, previousStage?: IStage) { this.refId = previousStage ? `${toInteger(previousStage.refId) + 1}` : '1'; this.requisiteStageRefIds = previousStage ? [previousStage.refId] : []; diff --git a/app/scripts/modules/netflix/fastProperties/domain/propertyStrategy.domain.ts b/app/scripts/modules/netflix/fastProperties/domain/propertyStrategy.domain.ts index a21c9ab9fbf..b4d88ed387d 100644 --- a/app/scripts/modules/netflix/fastProperties/domain/propertyStrategy.domain.ts +++ b/app/scripts/modules/netflix/fastProperties/domain/propertyStrategy.domain.ts @@ -26,8 +26,8 @@ export class ManualStrategy implements PropertyStrategy { public description: string = `Manual Strategy will add a Manual Judgement Stage after each Property Stage`; public configDetails: any = {}; - buildStage(user: IUser, command: PropertyCommand, previousStage?: IStage): IStage { - return new ManualJudgementStage(user, command, previousStage); + buildStage(user: IUser, _command: PropertyCommand, previousStage?: IStage): IStage { + return new ManualJudgementStage(user, previousStage); } isForcePush() { return false; } isManual() { return true; } @@ -59,7 +59,7 @@ export class ForcePushStrategy implements PropertyStrategy { public description: string = `Force Push Strategy will not put any safeguards in place and will push the Property change through.`; public configDetails: any = {}; - buildStage(user: IUser, command: PropertyCommand, previousStage?: IStage): IStage { + buildStage(_user: IUser, _command: PropertyCommand, _previousStage?: IStage): IStage { return undefined; } diff --git a/app/scripts/modules/netflix/fastProperties/scope/fastPropertyScopeSearch.component.ts b/app/scripts/modules/netflix/fastProperties/scope/fastPropertyScopeSearch.component.ts index d3372553977..7e95f0a7251 100644 --- a/app/scripts/modules/netflix/fastProperties/scope/fastPropertyScopeSearch.component.ts +++ b/app/scripts/modules/netflix/fastProperties/scope/fastPropertyScopeSearch.component.ts @@ -4,7 +4,6 @@ import { CATEGORY_BUTTON_LIST_COMPONENT } from './categoryButtonList.component'; import {debounce, uniqWith, isEqual} from 'lodash'; import { module } from 'angular'; -import {APPLICATION_READ_SERVICE, ApplicationReader} from 'core/application/service/application.read.service'; import {ACCOUNT_SERVICE, AccountService} from 'core/account/account.service'; import { FAST_PROPERTY_SCOPE_SEARCH_CATEGORY_SERVICE, FastPropertyScopeCategoryService } from './fastPropertyScopeSearchCategory.service'; import {Scope} from '../domain/scope.domain'; @@ -37,7 +36,6 @@ export class FastPropertyScopeSearchComponentController implements ng.IComponent '$q', 'infrastructureSearchService', 'accountService', - 'applicationReader', 'fastPropertyScopeSearchCategoryService' ]; } @@ -71,9 +69,8 @@ export class FastPropertyScopeSearchComponentController implements ng.IComponent constructor( private $q: ng.IQService, - private infrastructureSearchService: any, + infrastructureSearchService: any, private accountService: AccountService, - private applicationReader: ApplicationReader, private fastPropertyScopeSearchCategoryService: FastPropertyScopeCategoryService) { this.search = infrastructureSearchService(); this.executeQuery = debounce(this.executeQuery, 400); @@ -109,7 +106,7 @@ export class FastPropertyScopeSearchComponentController implements ng.IComponent /* * Query and build the category list */ - public dispatchQueryInput(evt: any) { + public dispatchQueryInput() { this.executeQuery(); } @@ -236,7 +233,6 @@ export const FAST_PROPERTY_SCOPE_SEARCH_COMPONENT = 'spinnaker.netflix.fastprope module(FAST_PROPERTY_SCOPE_SEARCH_COMPONENT, [ require('core/search/infrastructure/infrastructureSearch.service'), require('../fastProperty.read.service'), - APPLICATION_READ_SERVICE, ACCOUNT_SERVICE, FAST_PROPERTY_SCOPE_SEARCH_CATEGORY_SERVICE, CATEGORY_BUTTON_LIST_COMPONENT, diff --git a/app/scripts/modules/netflix/fastProperties/scope/fastPropertyScopeSearchCategory.service.ts b/app/scripts/modules/netflix/fastProperties/scope/fastPropertyScopeSearchCategory.service.ts index 1e62c689f72..ecfc681fcf5 100644 --- a/app/scripts/modules/netflix/fastProperties/scope/fastPropertyScopeSearchCategory.service.ts +++ b/app/scripts/modules/netflix/fastProperties/scope/fastPropertyScopeSearchCategory.service.ts @@ -57,7 +57,7 @@ export class FastPropertyScopeCategoryService { /** * Builds Global level fast property */ - private buildScopeForGlobal(selected: any): Scope[] { + private buildScopeForGlobal(): Scope[] { let scope: Scope = new Scope(); this.impactCountForGlobal() diff --git a/app/scripts/modules/netflix/fastProperties/wizard/monitor/propertyMonitorService.ts b/app/scripts/modules/netflix/fastProperties/wizard/monitor/propertyMonitorService.ts index 10ad7a8d422..ac42708252d 100644 --- a/app/scripts/modules/netflix/fastProperties/wizard/monitor/propertyMonitorService.ts +++ b/app/scripts/modules/netflix/fastProperties/wizard/monitor/propertyMonitorService.ts @@ -1,16 +1,9 @@ - import {module, noop} from 'angular'; import {IPipeline} from 'core/domain/IPipeline'; import {PROPERTY_MONITOR_COMPONENT} from './propertyMonitor.component'; export class PropertyMonitorService { - static get $inject() { - return ['$log']; - } - - public constructor(private $log: ng.ILogService ) {} - public buildMonitor(params: any): any { let monitor: any = { @@ -49,7 +42,6 @@ export class PropertyMonitorService { monitor.errorMessage = `There was an unknown server error. ${errorResponse}`; monitor.submitting = false; monitor.error = true; - this.$log.warn('Error with property:', errorResponse); }; monitor.handleTaskSuccess = function (pipeline: IPipeline): void { diff --git a/app/scripts/modules/netflix/fastProperties/wizard/propertyScope/propertyScope.component.ts b/app/scripts/modules/netflix/fastProperties/wizard/propertyScope/propertyScope.component.ts index 0aefb9d04e1..cfbdd38e355 100644 --- a/app/scripts/modules/netflix/fastProperties/wizard/propertyScope/propertyScope.component.ts +++ b/app/scripts/modules/netflix/fastProperties/wizard/propertyScope/propertyScope.component.ts @@ -10,20 +10,10 @@ export class FastPropertyScopeComponentController implements ng.IComponentContro public selectedScope: any; public command: PropertyCommand; - - static get $inject() { - return [ - 'fastPropertyReader' - ]; - } - - constructor( private fastPropertyReader: any ) {} - public selectScope(scopeOption: Scope) { this.selectedScope = scopeOption; this.command.scope = scopeOption; } - } class FastPropertyScopeComponent implements ng.IComponentOptions { diff --git a/app/scripts/modules/netflix/fastProperties/wizard/propertyScope/propertyScopeReadOnly.componet.ts b/app/scripts/modules/netflix/fastProperties/wizard/propertyScope/propertyScopeReadOnly.componet.ts index 04d44a43262..e3c6f57e1bf 100644 --- a/app/scripts/modules/netflix/fastProperties/wizard/propertyScope/propertyScopeReadOnly.componet.ts +++ b/app/scripts/modules/netflix/fastProperties/wizard/propertyScope/propertyScopeReadOnly.componet.ts @@ -15,14 +15,12 @@ export class FastPropertyScopeReadOnlyComponentController implements ng.ICompone static get $inject() { return [ - 'fastPropertyReader', 'fastPropertyScopeSearchCategoryService', ]; } constructor( - private fastPropertyReader: any, - private fastPropertyScopeSearchCategoryService: any ) { + fastPropertyScopeSearchCategoryService: any ) { fastPropertyScopeSearchCategoryService.getImpactForScope(this.command.scope) .then((counts: IImpactCounts) => { this.command.scope.instanceCounts = counts; @@ -49,7 +47,7 @@ class FastPropertyScopeReadOnlyComponent implements ng.IComponentOptions { export const FAST_PROPERTY_SCOPE_READ_ONLY_COMPONENT = 'spinnaker.netflix.fastProperty.scope.readOnly.component'; module(FAST_PROPERTY_SCOPE_READ_ONLY_COMPONENT, [ - require('../../../../core/search/searchResult/searchResult.directive'), + require('core/search/searchResult/searchResult.directive'), require('../../fastProperty.read.service'), FAST_PROPERTY_SCOPE_SEARCH_CATEGORY_SERVICE ]) diff --git a/app/scripts/modules/openstack/securityGroup/details/details.controller.spec.js b/app/scripts/modules/openstack/securityGroup/details/details.controller.spec.js index e337360b435..bc85aabe369 100644 --- a/app/scripts/modules/openstack/securityGroup/details/details.controller.spec.js +++ b/app/scripts/modules/openstack/securityGroup/details/details.controller.spec.js @@ -8,9 +8,7 @@ describe('Controller: openstackSecurityGroupDetailsController', function() { ); // Initialize the controller and a mock scope - var testSuite; beforeEach(window.inject(function ($controller, $rootScope, $q, settings) { - testSuite = this; this.settings = settings; diff --git a/app/scripts/modules/titus/migration/titusMigrationConfig.component.ts b/app/scripts/modules/titus/migration/titusMigrationConfig.component.ts index c96b7aadeee..8497c2023a7 100644 --- a/app/scripts/modules/titus/migration/titusMigrationConfig.component.ts +++ b/app/scripts/modules/titus/migration/titusMigrationConfig.component.ts @@ -80,9 +80,9 @@ export class TitusMigrationConfigController implements ng.IComponentController { public accounts: any[]; public regionsByAccount: any = {}; - static get $inject() { return ['$q', 'accountService']; } + static get $inject() { return ['accountService']; } - public constructor(private $q: ng.IQService, private accountService: any) {} + public constructor(private accountService: any) {} public $onInit(): void { this.config = this.application.attributes.titusTaskMigration || { diff --git a/package.json b/package.json index a3aec056fd8..ea00c123e64 100644 --- a/package.json +++ b/package.json @@ -61,12 +61,13 @@ "@types/angular-mocks": "1.5.8", "@types/angular-ui-bootstrap": "^0.13.38", "@types/angular-ui-router": "^1.1.35", - "@types/core-js": "^0.9.35", "@types/jasmine": "^2.5.38", "@types/jquery": "^2.0.34", "@types/lodash": "4.14.41", "@types/moment-timezone": "^0.2.32", "@types/node": "7.0.4", + "@types/webpack": "1.12.36", + "@types/webpack-env": "^1.13.0", "angular-loader": "./angular-loader", "angular-mocks": "1.5.8", "angulartics": "^1.1.2", @@ -75,20 +76,20 @@ "babel-loader": "^6.2.5", "babel-preset-es2015": "^6.13.2", "codelyzer": "0.0.28", - "css-loader": "^0.23.1", + "css-loader": "^0.26.1", "envify": "^1.2.1", "envify-loader": "^0.1.0", - "eslint": "^1.10.3", - "eslint-loader": "^1.2.0", - "exports-loader": "^0.6.2", - "expose-loader": "^0.7.0", - "file-loader": "^0.8.4", + "eslint": "^3.14.1", + "eslint-loader": "^1.6.1", + "exports-loader": "^0.6.3", + "expose-loader": "^0.7.1", + "file-loader": "^0.9.0", "happypack": "^2.2.1", - "html-loader": "^0.3.0", + "html-loader": "0.4.0", "html-webpack-plugin": "^2.24.1", - "imports-loader": "^0.6.4", - "istanbul-instrumenter-loader": "^0.1.3", - "json-loader": "^0.5.2", + "imports-loader": "^0.7.0", + "istanbul-instrumenter-loader": "^1.2.0", + "json-loader": "^0.5.4", "karma": "^1.3.0", "karma-chrome-launcher": "^2.0.0", "karma-coverage": "^1.1.1", @@ -97,8 +98,8 @@ "karma-mocha-reporter": "^2.1.0", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^1.8.0", - "less": "^2.5.1", - "less-loader": "^2.2.0", + "less": "^2.7.2", + "less-loader": "^2.2.3", "n3-charts": "^2.0.18", "ng-annotate-loader": "0.0.4", "ng-annotate-webpack-plugin": "^0.1.2", @@ -106,13 +107,13 @@ "node-libs-browser": "^0.5.2", "octicons": "^2.2.0", "protractor": "^2.2.0", - "style-loader": "^0.12.3", - "ts-loader": "^1.3.0", + "style-loader": "^0.13.1", + "ts-loader": "^2.0.0", "tslint": "^3.15.1", "tslint-loader": "^2.1.5", "typescript": "2.0.10", "typings": "^1.3.3", - "url-loader": "^0.5.6", + "url-loader": "^0.5.7", "webpack": "^1.9.11", "webpack-dev-server": "^1.9.0" } diff --git a/tsconfig.json b/tsconfig.json index 2dfe291c4d0..9b6ac4856dc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,8 @@ "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": false, // should really get to a place where we can turn this on + "noUnusedLocals": true, + "noUnusedParameters": true, "outDir": "transpiled", "pretty": true, "removeComments": true, @@ -21,18 +23,7 @@ "strictNullChecks": false, // should really get to a place where we can turn this on "target": "es5", "typeRoots": [ - "node_modules/@types/" - ], - "types": [ - "angular", - "angular-mocks", - "angular-ui-bootstrap", - "angular-ui-router", - "jasmine", - "jquery", - "lodash", - "moment-timezone", - "node" + "node_modules/@types" ] }, "exclude": [ diff --git a/webpack.common.js b/webpack.common.js index afd1e009525..5596f72ae6d 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -12,7 +12,14 @@ function configure(IS_TEST) { function getTypescriptLinterLoader() { return { loader: 'tslint', - test: IS_TEST ? /\.spec.ts$/ : /\.ts$/ + test: /\.(spec\.)?ts$/ + }; + } + + function getJavascriptLinterLoader() { + return { + loader: 'eslint', + test: /\.(spec\.)?js$/ }; } @@ -105,21 +112,15 @@ function configure(IS_TEST) { } } - config.module.preLoaders.push(getTypescriptLinterLoader()); + config.module.preLoaders.push(getTypescriptLinterLoader(), getJavascriptLinterLoader()); config.module.loaders.push(getJavascriptLoader(), getLessLoader(), getHtmlLoader()); if (IS_TEST) { - config.module.postLoaders = [{ - test: /\.js$/, - exclude: /(test|node_modules|bower_components)\//, - loader: 'istanbul-instrumenter' - }]; - config.plugins = [ new HappyPack({ id: 'jstest', - loaders: ['ng-annotate!angular!babel!envify!eslint'], + loaders: ['ng-annotate!angular!babel!envify'], threadPool: happyThreadPool, cacheContext: { env: process.env, @@ -139,7 +140,7 @@ function configure(IS_TEST) { }), new HappyPack({ id: 'js', - loaders: ['ng-annotate!angular!babel!envify!eslint'], + loaders: ['ng-annotate!angular!babel!envify'], threadPool: happyThreadPool, cacheContext: { env: process.env,