From 46813be9f42e89c47a3b47048426e0b5f00d70e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 28 Aug 2024 10:12:39 +0200 Subject: [PATCH] Fix eslint --- src/message/Notification_OLD.js | 12 ++++-------- src/offline/component.js | 6 +++--- src/olcs/Service.js | 6 +++--- src/olcs/controls3d.js | 6 +++--- src/raster/component.js | 2 +- 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/message/Notification_OLD.js b/src/message/Notification_OLD.js index 57d7ac901fb5..947df2eb89b0 100644 --- a/src/message/Notification_OLD.js +++ b/src/message/Notification_OLD.js @@ -105,20 +105,16 @@ export class MessageNotification extends ngeoMessageMessage { console.assert(typeof type == 'string', 'Type should be set.'); const classNames = ['alert', 'fade', 'show']; switch (type) { - case MessageType.ERROR: - // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison + case MessageType.ERROR: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison classNames.push('alert-danger'); break; - case MessageType.INFORMATION: - // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison + case MessageType.INFORMATION: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison classNames.push('alert-info'); break; - case MessageType.SUCCESS: - // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison + case MessageType.SUCCESS: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison classNames.push('alert-success'); break; - case MessageType.WARNING: - // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison + case MessageType.WARNING: // eslint-disable-line @typescript-eslint/no-unsafe-enum-comparison classNames.push('alert-warning'); break; default: diff --git a/src/offline/component.js b/src/offline/component.js index 956b9a88cd98..53642ba343dc 100644 --- a/src/offline/component.js +++ b/src/offline/component.js @@ -102,7 +102,7 @@ const component = { templateUrl: ngeoOfflineTemplateUrl, }; myModule.component('ngeoOffline', component); -export const Controller = class _ngInjectAnonymousClass { +export class Controller { /** * @param {angular.ITimeoutService} $timeout Angular timeout service. * @param {import('ngeo/offline/ServiceManager').default} ngeoOfflineServiceManager @@ -565,8 +565,8 @@ export const Controller = class _ngInjectAnonymousClass { const maskSizeMeter = (maskSizePixel * (this.map.getView().getResolution() || 1)) / DEVICE_PIXEL_RATIO; return maskSizeMeter; } -}; -_ngInjectAnonymousClass.$inject = [ +} +Controller.$inject = [ '$timeout', 'ngeoOfflineServiceManager', 'ngeoOfflineConfiguration', diff --git a/src/olcs/Service.js b/src/olcs/Service.js index 21728f908095..2d766dfa6aa3 100644 --- a/src/olcs/Service.js +++ b/src/olcs/Service.js @@ -29,7 +29,7 @@ import {toDegrees} from 'ol/math'; /** * @hidden */ -export const OlcsService = class _ngInjectAnonymousClass { +export class OlcsService { /** * @param {import('ngeo/misc/debounce').miscDebounce} ngeoDebounce ngeo debounce * service. @@ -152,8 +152,8 @@ export const OlcsService = class _ngInjectAnonymousClass { this.ngeoStateManager_.deleteParam(key); }); } -}; -_ngInjectAnonymousClass.$inject = ['ngeoDebounce', 'ngeoLocation', 'ngeoStateManager']; +} +OlcsService.$inject = ['ngeoDebounce', 'ngeoLocation', 'ngeoStateManager']; /** * @type {angular.IModule} * @hidden diff --git a/src/olcs/controls3d.js b/src/olcs/controls3d.js index 60c66332ce33..340a32c3b7a3 100644 --- a/src/olcs/controls3d.js +++ b/src/olcs/controls3d.js @@ -47,7 +47,7 @@ function shouldUpdate(older, newer) { /** * @hidden */ -export const Controller = class _ngInjectAnonymousClass { +export class Controller { /** * @param {JQuery} $element The element * @param {import('ngeo/olcs/Service').OlcsService} ngeoOlcsService The ol-cesium service. @@ -252,8 +252,8 @@ export const Controller = class _ngInjectAnonymousClass { easing: olEasing.easeOut, }); } -}; -_ngInjectAnonymousClass.$inject = ['$element', 'ngeoOlcsService']; +} +Controller.$inject = ['$element', 'ngeoOlcsService']; /** * @param {angular.IAttributes} $attrs Attributes. * @param {string} ngeoOlcsControls3dTemplateUrl Template function. diff --git a/src/raster/component.js b/src/raster/component.js index 50294b6f816c..49e366ec0463 100644 --- a/src/raster/component.js +++ b/src/raster/component.js @@ -312,7 +312,7 @@ Controller.prototype.getRasterSuccess_ = function (resp) { const separator = postfix.length > 0 ? (options.hasOwnProperty('separator') ? options.separator : '\u00a0') : ''; const args = Array.prototype.concat([value], custom_args); - const elevation = /** @type {string} */ this.filter_(filter)(...args); + const elevation = /** @type {string} */ (this.filter_(filter)(...args)); if (typeof elevation != 'string') { throw new Error('Wrong elevation type'); }