diff --git a/ui/.eslintrc.json b/ui/.eslintrc.json index 419e1faab58..939db3ad5a0 100644 --- a/ui/.eslintrc.json +++ b/ui/.eslintrc.json @@ -30,15 +30,8 @@ "plugin:@angular-eslint/template/process-inline-templates" ], "rules": { + "curly": "error", "unused-imports/no-unused-imports": "error", - "@stylistic/semi": [ - "error", - "always" - ], - "@stylistic/quote-props": [ - "warn", - "consistent" - ], "@typescript-eslint/explicit-member-accessibility": [ "error", { @@ -67,15 +60,16 @@ "style": "camelCase" } ], - "curly": "error", + "@stylistic/semi": "error", + "@stylistic/quote-props": [ + "warn", + "consistent" + ], "@stylistic/comma-dangle": [ "error", "always-multiline" ], - "@stylistic/eol-last": [ - "error", - "always" - ], + "@stylistic/eol-last": "error", "@stylistic/no-trailing-spaces": "error", "@typescript-eslint/no-unused-vars": [ "error", @@ -90,9 +84,7 @@ { "extendDefaults": true, "types": { - "{}": false, - "Object": false, - "Function": false + "{}": false } } ] diff --git a/ui/src/app/edge/settings/system/maintenance/maintenance.ts b/ui/src/app/edge/settings/system/maintenance/maintenance.ts index 05ffad598c8..cb50d645a98 100644 --- a/ui/src/app/edge/settings/system/maintenance/maintenance.ts +++ b/ui/src/app/edge/settings/system/maintenance/maintenance.ts @@ -45,7 +45,7 @@ export class MaintenanceComponent implements OnInit { protected systemRestartState: BehaviorSubject<{ key: Type, state: SystemRestartState }> = new BehaviorSubject({ key: null, state: SystemRestartState.INITIAL }); protected spinnerId: string = MaintenanceComponent.SELECTOR; protected readonly SystemRestartState = SystemRestartState; - protected confirmationAlert: Function = (type: Type) => presentAlert(this.alertCtrl, this.translate, { + protected confirmationAlert: (type: Type) => void = (type: Type) => presentAlert(this.alertCtrl, this.translate, { message: this.translate.instant('SETTINGS.SYSTEM_UPDATE.RESTART_WARNING', { system: environment.edgeShortName }), subHeader: this.translate.instant('SETTINGS.SYSTEM_UPDATE.RESTART_CONFIRMATION', { system: environment.edgeShortName }), buttons: [{ diff --git a/ui/src/app/edge/settings/system/oe-system-update.component.ts b/ui/src/app/edge/settings/system/oe-system-update.component.ts index f76d9d9725f..7b0689beab5 100644 --- a/ui/src/app/edge/settings/system/oe-system-update.component.ts +++ b/ui/src/app/edge/settings/system/oe-system-update.component.ts @@ -21,7 +21,7 @@ export class OeSystemUpdateComponent implements OnInit, OnDestroy { protected executeUpdate: ExecuteSystemUpdate = null; protected isWaiting: boolean; - protected confirmationAlert: Function = () => presentAlert(this.alertCtrl, this.translate, { + protected confirmationAlert: () => void = () => presentAlert(this.alertCtrl, this.translate, { message: this.translate.instant('SETTINGS.SYSTEM_UPDATE.WARNING', { system: environment.edgeShortName }), subHeader: this.translate.instant('SETTINGS.SYSTEM_UPDATE.SUB_HEADER'), buttons: [{ diff --git a/ui/src/app/shared/genericComponents/modal/modal-button/modal-button.ts b/ui/src/app/shared/genericComponents/modal/modal-button/modal-button.ts index 74d01588bb1..0c118509ce9 100644 --- a/ui/src/app/shared/genericComponents/modal/modal-button/modal-button.ts +++ b/ui/src/app/shared/genericComponents/modal/modal-button/modal-button.ts @@ -18,5 +18,5 @@ export type ButtonLabel = { value: string; /** Icons for Button, displayed above the corresponding name */ icons?: Icon; - callback?: Function; + callback?: () => void; }; diff --git a/ui/src/app/shared/genericComponents/shared/oe-formly-component.ts b/ui/src/app/shared/genericComponents/shared/oe-formly-component.ts index 67d6d92e92a..50516a057d5 100644 --- a/ui/src/app/shared/genericComponents/shared/oe-formly-component.ts +++ b/ui/src/app/shared/genericComponents/shared/oe-formly-component.ts @@ -4,7 +4,7 @@ import { FormlyFieldConfig } from "@ngx-formly/core"; import { TranslateService } from "@ngx-translate/core"; import { filter } from "rxjs/operators"; -import { ChannelAddress, EdgeConfig, Service } from "../../shared"; +import { CurrentData, ChannelAddress, EdgeConfig, Service } from "../../shared"; import { SharedModule } from "../../shared.module"; import { Role } from "../../type/role"; import { TextIndentation } from "../modal/modal-line/modal-line"; @@ -99,7 +99,7 @@ export namespace OeFormlyField { export type ValueFromChannelsLine = { type: 'value-from-channels-line', name: string, - value: Function, + value: (data: CurrentData) => string, channelsToSubscribe: ChannelAddress[], indentation?: TextIndentation, filter?: (value: number[] | null) => boolean, diff --git a/ui/src/app/shared/service/service.ts b/ui/src/app/shared/service/service.ts index 771b140ab6e..64997f0428c 100644 --- a/ui/src/app/shared/service/service.ts +++ b/ui/src/app/shared/service/service.ts @@ -126,7 +126,7 @@ export class Service extends AbstractService { // this.notify(notification); } - public setCurrentComponent(currentPageTitle: string | { languageKey: string, interpolateParams?: Object }, activatedRoute: ActivatedRoute): Promise { + public setCurrentComponent(currentPageTitle: string | { languageKey: string, interpolateParams?: {} }, activatedRoute: ActivatedRoute): Promise { return new Promise((resolve, reject) => { // Set the currentPageTitle only once per ActivatedRoute if (this.currentActivatedRoute != activatedRoute) {