diff --git a/.eslintrc.yaml b/.eslintrc.yaml index ab8beb119f9e..a421fb654ef0 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -13,3 +13,4 @@ rules: max-len: - error - code: 110 + ignoreComments: true diff --git a/api/src/Themes.js b/api/src/Themes.js index df5ae7c85b0e..8790ba34cc2f 100644 --- a/api/src/Themes.js +++ b/api/src/Themes.js @@ -245,7 +245,7 @@ const capabilities = new Map(); * @return {Promise} Any */ function getWMTSCapability(url) { - if (!(url in capabilities)) { + if (!capabilities.has(url)) { const request = fetch(url) .then(response => response.text()) .then((capability) => { diff --git a/contribs/gmf/examples/layertree.js b/contribs/gmf/examples/layertree.js index 37cc9c462cd9..fa0dac6acf9f 100644 --- a/contribs/gmf/examples/layertree.js +++ b/contribs/gmf/examples/layertree.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import appURL from './url.js'; import './layertree.css'; diff --git a/contribs/gmf/examples/layertreeadd.js b/contribs/gmf/examples/layertreeadd.js index 29cd4928505b..5ce8cd1d68e1 100644 --- a/contribs/gmf/examples/layertreeadd.js +++ b/contribs/gmf/examples/layertreeadd.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import appURL from './url.js'; import './layertreeadd.css'; diff --git a/contribs/gmf/examples/xsdattributes.js b/contribs/gmf/examples/xsdattributes.js index 38bad63bfb07..4b77645ae135 100644 --- a/contribs/gmf/examples/xsdattributes.js +++ b/contribs/gmf/examples/xsdattributes.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import appURL from './url.js'; import './xsdattributes.css'; diff --git a/contribs/gmf/src/controllers/AbstractAppController.js b/contribs/gmf/src/controllers/AbstractAppController.js index d0c3776bdf47..8df7b200a731 100644 --- a/contribs/gmf/src/controllers/AbstractAppController.js +++ b/contribs/gmf/src/controllers/AbstractAppController.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import 'jquery'; import angular from 'angular'; import 'angular-gettext'; diff --git a/contribs/gmf/src/datasource/ExternalDataSourcesManager.js b/contribs/gmf/src/datasource/ExternalDataSourcesManager.js index fe62d7c607af..4168221d5faf 100644 --- a/contribs/gmf/src/datasource/ExternalDataSourcesManager.js +++ b/contribs/gmf/src/datasource/ExternalDataSourcesManager.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - // TODO - MaxScaleDenominator // TODO - MinScaleDenominator diff --git a/contribs/gmf/src/datasource/Helper.js b/contribs/gmf/src/datasource/Helper.js index 286acfe657fc..4ccedc99aa04 100644 --- a/contribs/gmf/src/datasource/Helper.js +++ b/contribs/gmf/src/datasource/Helper.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import gmfEditingEnumerateAttribute from 'gmf/editing/EnumerateAttribute.js'; import ngeoDatasourceHelper from 'ngeo/datasource/Helper.js'; diff --git a/contribs/gmf/src/editing/editFeatureComponent.js b/contribs/gmf/src/editing/editFeatureComponent.js index 93a4601e31af..bd2aa2c35e05 100644 --- a/contribs/gmf/src/editing/editFeatureComponent.js +++ b/contribs/gmf/src/editing/editFeatureComponent.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import gmfEditingEditFeature from 'gmf/editing/EditFeature.js'; diff --git a/contribs/gmf/src/filters/filterselectorComponent.js b/contribs/gmf/src/filters/filterselectorComponent.js index 7adeb1c79a0c..358059bb41a2 100644 --- a/contribs/gmf/src/filters/filterselectorComponent.js +++ b/contribs/gmf/src/filters/filterselectorComponent.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import {CollectionEvent} from 'ol/Collection.js'; import gmfAuthenticationService from 'gmf/authentication/Service.js'; diff --git a/contribs/gmf/src/import/importdatasourceComponent.js b/contribs/gmf/src/import/importdatasourceComponent.js index 5564ea149713..1aa095669caf 100644 --- a/contribs/gmf/src/import/importdatasourceComponent.js +++ b/contribs/gmf/src/import/importdatasourceComponent.js @@ -1,4 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ /* global Bloodhound */ import angular from 'angular'; diff --git a/contribs/gmf/src/layertree/component.js b/contribs/gmf/src/layertree/component.js index 353ddb9ff43c..3304db144b0f 100644 --- a/contribs/gmf/src/layertree/component.js +++ b/contribs/gmf/src/layertree/component.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import {DATALAYERGROUP_NAME} from 'gmf/index.js'; import gmfDatasourceDataSourceBeingFiltered from 'gmf/datasource/DataSourceBeingFiltered.js'; diff --git a/contribs/gmf/src/lidarprofile/Manager.js b/contribs/gmf/src/lidarprofile/Manager.js index c7affd63d849..b2ec4d70d45e 100644 --- a/contribs/gmf/src/lidarprofile/Manager.js +++ b/contribs/gmf/src/lidarprofile/Manager.js @@ -374,8 +374,8 @@ export class LidarprofileManager { } catch (e) { if (!this.isPlotSetup_) { const canvas = d3select('#gmf-lidarprofile-container .lidar-canvas'); - const canvasEl = canvas.node(); - const ctx = canvasEl.getContext('2d'); + const canvasEl = /** @type {HTMLCanvasElement} */ (canvas.node()); + const ctx = /** @type {CanvasRenderingContext2D} */ (canvasEl.getContext('2d')); ctx.clearRect(0, 0, canvasEl.getBoundingClientRect().width, canvasEl.getBoundingClientRect().height); canvas.selectAll('*').remove(); const errorTxt = this.getHTMLError_(); diff --git a/contribs/gmf/src/lidarprofile/Measure.js b/contribs/gmf/src/lidarprofile/Measure.js index 60f25887f2c5..9dde103c2fb1 100644 --- a/contribs/gmf/src/lidarprofile/Measure.js +++ b/contribs/gmf/src/lidarprofile/Measure.js @@ -73,8 +73,12 @@ export default class { throw new Error('Missing manager.plot'); } const svg = d3select('#gmf-lidarprofile-container svg.lidar-svg'); - const svgCoordinates = d3mouse(svg.node()); - const canvasCoordinates = d3mouse(d3select('#gmf-lidarprofile-container .lidar-canvas').node()); + const svgEl = /** @type {HTMLElement} */ (svg.node()); + const canvas = d3select('#gmf-lidarprofile-container .lidar-canvas'); + const canvasEl = /** @type {HTMLCanvasElement} */ (canvas.node()); + + const svgCoordinates = d3mouse(svgEl); + const canvasCoordinates = d3mouse(canvasEl); const margin = this.manager_.config.clientConfig.margin; const xs = svgCoordinates[0]; const ys = svgCoordinates[1]; diff --git a/contribs/gmf/src/lidarprofile/Plot.js b/contribs/gmf/src/lidarprofile/Plot.js index fed32df6026b..0fd47e4738c4 100644 --- a/contribs/gmf/src/lidarprofile/Plot.js +++ b/contribs/gmf/src/lidarprofile/Plot.js @@ -103,7 +103,9 @@ export default class { let i = -1; const nPoints = points.distance.length; let cx, cy; - const ctx = d3select('#gmf-lidarprofile-container .lidar-canvas').node().getContext('2d'); + const canvas = d3select('#gmf-lidarprofile-container .lidar-canvas'); + const canvasEl = /** @type {HTMLCanvasElement} */ (canvas.node()); + const ctx = /** @type {CanvasRenderingContext2D} */ (canvasEl.getContext('2d')); const profileServerConfig = this.manager_.config.serverConfig; while (++i < nPoints) { @@ -151,12 +153,13 @@ export default class { throw new Error('Missing manager_.config.serverConfig'); } const canvas = d3select('#gmf-lidarprofile-container .lidar-canvas'); - const canvasEl = canvas.node(); - const ctx = canvasEl.getContext('2d'); + const canvasEl = /** @type {HTMLCanvasElement} */ (canvas.node()); + const ctx = /** @type {CanvasRenderingContext2D} */ (canvasEl.getContext('2d')); ctx.clearRect(0, 0, canvasEl.getBoundingClientRect().width, canvasEl.getBoundingClientRect().height); const margin = this.manager_.config.clientConfig.margin; - const containerEl = d3select('#gmf-lidarprofile-container').node(); + const container = d3select('#gmf-lidarprofile-container'); + const containerEl = /** @type {HTMLElement} */ (container.node()); const containerWidth = containerEl.getBoundingClientRect().width; const containerHeight = containerEl.getBoundingClientRect().height; this.width_ = containerWidth - (margin.left + margin.right); @@ -217,7 +220,7 @@ export default class { const svg = d3select('#gmf-lidarprofile-container svg.lidar-svg'); - svg.call(zoom).on('dblclick.zoom', null); + svg.call(/** @type {any} */ (zoom)).on('dblclick.zoom', null); svg.selectAll('*').remove(); @@ -261,8 +264,9 @@ export default class { return; } this.moved_ = false; - const ctx = d3select('#gmf-lidarprofile-container .lidar-canvas') - .node().getContext('2d'); + const canvas = d3select('#gmf-lidarprofile-container .lidar-canvas'); + const canvasEl = /** @type {HTMLCanvasElement} */ (canvas.node()); + const ctx = /** @type {CanvasRenderingContext2D} */ (canvasEl.getContext('2d')); ctx.clearRect(0, 0, this.width_, this.height_); this.manager_.updateData(); } @@ -299,11 +303,12 @@ export default class { const new_scaleX = tr.rescaleX(this.scaleX); const new_scaleY = tr.rescaleY(this.scaleY); - svg.select('.x.axis').call(xAxis.scale(new_scaleX)); - svg.select('.y.axis').call(yAxis.scale(new_scaleY)); + svg.select('.x.axis').call(/** @type {any} */ (xAxis.scale(new_scaleX))); + svg.select('.y.axis').call(/** @type {any} */ (yAxis.scale(new_scaleY))); - const ctx = d3select('#gmf-lidarprofile-container .lidar-canvas') - .node().getContext('2d'); + const canvas = d3select('#gmf-lidarprofile-container .lidar-canvas'); + const canvasEl = /** @type {HTMLCanvasElement} */ (canvas.node()); + const ctx = /** @type {CanvasRenderingContext2D} */ (canvasEl.getContext('2d')); ctx.clearRect(0, 0, this.width_, this.height_); svg.select('.y.axis').selectAll('g.tick line') @@ -333,7 +338,9 @@ export default class { const margin = this.manager_.config.clientConfig.margin; const tolerance = this.manager_.config.clientConfig.tolerance || 0; - const canvasCoordinates = d3mouse(d3select('#gmf-lidarprofile-container .lidar-canvas').node()); + const canvas = d3select('#gmf-lidarprofile-container .lidar-canvas'); + const canvasEl = /** @type {HTMLCanvasElement} */ (canvas.node()); + const canvasCoordinates = d3mouse(canvasEl); const classification_colors = this.manager_.config.serverConfig.classification_colors; let cx, cy; @@ -443,8 +450,9 @@ export default class { */ changeStyle(material) { this.material = material; - const canvasEl = d3select('#gmf-lidarprofile-container .lidar-canvas').node(); - const ctx = canvasEl.getContext('2d'); + const canvas = d3select('#gmf-lidarprofile-container .lidar-canvas'); + const canvasEl = /** @type {HTMLCanvasElement} */ (canvas.node()); + const ctx = /** @type {CanvasRenderingContext2D} */ (canvasEl.getContext('2d')); ctx.clearRect(0, 0, canvasEl.width, canvasEl.height); this.drawPoints(this.manager_.profilePoints); } diff --git a/contribs/gmf/src/lidarprofile/Utils.js b/contribs/gmf/src/lidarprofile/Utils.js index eefe8a9c1be5..4f1605cb4213 100644 --- a/contribs/gmf/src/lidarprofile/Utils.js +++ b/contribs/gmf/src/lidarprofile/Utils.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import olFeature from 'ol/Feature.js'; import olGeomLineString from 'ol/geom/LineString.js'; import olGeomPoint from 'ol/geom/Point.js'; @@ -250,14 +248,16 @@ export default class { ctx.fillRect(0, 0, w, h); // Draw the profile canvas (the points) into the new canvas. - const profileCanvas = d3select('#gmf-lidarprofile-container .lidar-canvas').node(); - ctx.drawImage(profileCanvas, margin.left, margin.top, + const profileCanvas = d3select('#gmf-lidarprofile-container .lidar-canvas'); + const profileCanvasEl = /** @type {HTMLCanvasElement} */ (profileCanvas.node()); + ctx.drawImage(profileCanvasEl, margin.left, margin.top, w - (margin.left + margin.right), h - (margin.top + margin.bottom)); // Add transforms the profile into an image. const exportImage = new Image(); const serializer = new XMLSerializer(); - const svgStr = serializer.serializeToString(profileSVG.node()); + const profileSVGEl = /** @type {HTMLElement} */ (profileSVG.node()); + const svgStr = serializer.serializeToString(profileSVGEl); // Draw the image of the profile into the context of the new canvas. const img_id = 'lidare_profile_for_export_uid'; diff --git a/contribs/gmf/src/objectediting/component.js b/contribs/gmf/src/objectediting/component.js index 8c9ac6f97ba7..59fd1374d53d 100644 --- a/contribs/gmf/src/objectediting/component.js +++ b/contribs/gmf/src/objectediting/component.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import gmfEditingEditFeature from 'gmf/editing/EditFeature.js'; import gmfLayertreeSyncLayertreeMap, {getLayer as syncLayertreeMapGetLayer} diff --git a/contribs/gmf/src/objectediting/toolsComponent.js b/contribs/gmf/src/objectediting/toolsComponent.js index cef7ac082de6..c4f5c7f9d141 100644 --- a/contribs/gmf/src/objectediting/toolsComponent.js +++ b/contribs/gmf/src/objectediting/toolsComponent.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import gmfObjecteditingGetWMSFeatureComponent from 'gmf/objectediting/getWMSFeatureComponent.js'; diff --git a/contribs/gmf/src/print/component.js b/contribs/gmf/src/print/component.js index 5a1b412c2103..19f4e4033db0 100644 --- a/contribs/gmf/src/print/component.js +++ b/contribs/gmf/src/print/component.js @@ -1416,13 +1416,13 @@ export class PrintController { } } } - if (!legendImage) { - throw new Error('Missing legendImage'); + + if (legendImage) { + return { + url: legendImage, + dpi: found_dpi, + }; } - return { - url: legendImage, - dpi: found_dpi, - }; } diff --git a/contribs/gmf/src/raster/component.js b/contribs/gmf/src/raster/component.js index 2155bb34c903..6bf25d89acc5 100644 --- a/contribs/gmf/src/raster/component.js +++ b/contribs/gmf/src/raster/component.js @@ -134,8 +134,7 @@ module.directive('gmfElevation', rasterComponent); * @hidden * @param {angular.IScope} $scope Scope. * @param {angular.IFilterService} $filter Angular filter. - * @param {import("ngeo/misc/debounce.js").miscDebounce} ngeoDebounce Ngeo debounce factory + * @param {import("ngeo/misc/debounce.js").miscDebounce} ngeoDebounce Ngeo debounce factory * @param {import("gmf/raster/RasterService.js").RasterService} gmfRaster Gmf Raster service * @param {angular.gettext.gettextCatalog} gettextCatalog Gettext catalog. * @constructor @@ -148,26 +147,21 @@ module.directive('gmfElevation', rasterComponent); function Controller($scope, $filter, ngeoDebounce, gmfRaster, gettextCatalog) { /** - * @type {angular.IFilterService} * @private */ this.filter_ = $filter; /** - * @type {import("ngeo/misc/debounce.js").miscDebounce< - * function(Event|import('ol/events/Event.js').default): void>} * @private */ this.ngeoDebounce_ = ngeoDebounce; /** - * @type {import("gmf/raster/RasterService.js").RasterService} * @private */ this.gmfRaster_ = gmfRaster; /** - * @type {angular.gettext.gettextCatalog} * @private */ this.gettextCatalog = gettextCatalog; diff --git a/contribs/gmf/src/search/component.js b/contribs/gmf/src/search/component.js index d17663e1f417..c138ec3481e5 100644 --- a/contribs/gmf/src/search/component.js +++ b/contribs/gmf/src/search/component.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import {COORDINATES_LAYER_NAME} from 'gmf/index.js'; import gmfLayertreeTreeManager from 'gmf/layertree/TreeManager.js'; diff --git a/examples/common_dependencies.js b/examples/common_dependencies.js index 05c400f61590..96467b0b7460 100644 --- a/examples/common_dependencies.js +++ b/examples/common_dependencies.js @@ -1,4 +1,4 @@ -import './common_dependencies.scss' +import './common_dependencies.scss'; import 'jquery'; import 'angular'; import 'angular-gettext'; diff --git a/examples/locationsearch.js b/examples/locationsearch.js index 43695dff73da..b323225eb016 100644 --- a/examples/locationsearch.js +++ b/examples/locationsearch.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import './locationsearch.css'; import angular from 'angular'; diff --git a/examples/permalink.js b/examples/permalink.js index a8f558274d7c..915b716f1c9d 100644 --- a/examples/permalink.js +++ b/examples/permalink.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import './permalink.css'; import angular from 'angular'; import ngeoFormatFeatureHash from 'ngeo/format/FeatureHash.js'; diff --git a/examples/search.js b/examples/search.js index 476135764cd7..1d42f8cea94f 100644 --- a/examples/search.js +++ b/examples/search.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import {SEARCH} from './url.js'; import './search.css'; diff --git a/src/editing/createfeatureComponent.js b/src/editing/createfeatureComponent.js index 6f02a2766ab0..3f48ee3dacc5 100644 --- a/src/editing/createfeatureComponent.js +++ b/src/editing/createfeatureComponent.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import ngeoMiscFilters from 'ngeo/misc/filters.js'; import ngeoGeometryType from 'ngeo/GeometryType.js'; diff --git a/src/filter/RuleHelper.js b/src/filter/RuleHelper.js index bf49ed355713..ede516ffd391 100644 --- a/src/filter/RuleHelper.js +++ b/src/filter/RuleHelper.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import ngeoFilterCondition from 'ngeo/filter/Condition.js'; import ngeoFormatAttributeType from 'ngeo/format/AttributeType.js'; diff --git a/src/format/FeatureHash.js b/src/format/FeatureHash.js index cc659ea32e17..3bc35718e1f4 100644 --- a/src/format/FeatureHash.js +++ b/src/format/FeatureHash.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import ngeoFormatFeatureProperties from 'ngeo/format/FeatureProperties.js'; import ngeoFormatFeatureHashStyleType from 'ngeo/format/FeatureHashStyleType.js'; import {rgbArrayToHex} from 'ngeo/utils.js'; diff --git a/src/interaction/Measure.js b/src/interaction/Measure.js index 985fddbe7284..8459f0f0d727 100644 --- a/src/interaction/Measure.js +++ b/src/interaction/Measure.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import ngeoCustomEvent from 'ngeo/CustomEvent.js'; import * as olDom from 'ol/dom.js'; import * as olProj from 'ol/proj.js'; diff --git a/src/map/FeatureOverlay.js b/src/map/FeatureOverlay.js index 891d32c55a0f..0748ee13cfd4 100644 --- a/src/map/FeatureOverlay.js +++ b/src/map/FeatureOverlay.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import * as olEvents from 'ol/events.js'; import {CollectionEvent} from 'ol/Collection.js'; diff --git a/src/message/Disclaimer.js b/src/message/Disclaimer.js index d14addd993db..499bac6725bd 100644 --- a/src/message/Disclaimer.js +++ b/src/message/Disclaimer.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import 'bootstrap/js/src/alert.js'; diff --git a/src/message/Notification.js b/src/message/Notification.js index 5000b285f624..aa5d8598b7b1 100644 --- a/src/message/Notification.js +++ b/src/message/Notification.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import 'bootstrap/js/src/alert.js'; diff --git a/src/misc/filters.js b/src/misc/filters.js index 8ffb650cfb01..f978be5d3113 100644 --- a/src/misc/filters.js +++ b/src/misc/filters.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import {modulo} from 'ol/math.js'; import {padNumber} from 'ol/string.js'; diff --git a/src/misc/php-date-formatter.js b/src/misc/php-date-formatter.js index 1e2a6cceee36..7045e1f0dd5f 100644 --- a/src/misc/php-date-formatter.js +++ b/src/misc/php-date-formatter.js @@ -1,5 +1,4 @@ // @ts-nocheck -/* eslint max-len: 0 */ /*! * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2017 @@ -16,6 +15,9 @@ * For more Yii related demos visit http://demos.krajee.com */ + +/* eslint max-len: 0 */ +/* eslint @openlayers/valid-tsdoc: 0 */ /* eslint valid-jsdoc: 0 */ /* eslint quotes: 0 */ /* eslint indent: 0 */ diff --git a/src/print/VectorEncoder.js b/src/print/VectorEncoder.js index 3acce521a899..f7d27d1f8830 100644 --- a/src/print/VectorEncoder.js +++ b/src/print/VectorEncoder.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import {rgbArrayToHex} from 'ngeo/utils.js'; import {getUid as olUtilGetUid} from 'ol/util.js'; import olFormatGeoJSON from 'ol/format/GeoJSON.js'; diff --git a/src/profile/d3Elevation.js b/src/profile/d3Elevation.js index 3aadb5a6d49b..a5d98d77b908 100644 --- a/src/profile/d3Elevation.js +++ b/src/profile/d3Elevation.js @@ -266,9 +266,7 @@ function d3Elevation(options) { height = Math.max(this.clientHeight - margin.top - margin.bottom, 0); y = d3scaleLinear().range([height, 0]); - /** @type {import('d3').Axis} */ const xAxis = d3axisBottom(x); - /** @type {import('d3').Axis} */ const yAxis = d3axisLeft(y); /** @type {?d3.Area<[number, number]>} */ @@ -449,7 +447,7 @@ function d3Elevation(options) { g.select('.x.axis') .transition() - .call(xAxis); + .call(/** @type {any}*/ (xAxis)); g.select('.x.label') .text(`${xAxisLabel} [${xUnits}]`) @@ -463,12 +461,12 @@ function d3Elevation(options) { g.select('.y.axis') .transition() - .call(yAxis); + .call(/** @type {any}*/ (yAxis)); } g.select('.grid-y') .transition() - .call(yAxis.tickSize(-width).tickFormat(null)) + .call(/** @type {any}*/ (yAxis.tickSize(-width).tickFormat(null))) .selectAll('.tick line') .style('stroke', '#ccc') .style('opacity', 0.7); diff --git a/src/profile/elevationComponent.js b/src/profile/elevationComponent.js index 7e4eabd52aa1..d995bc69e7e2 100644 --- a/src/profile/elevationComponent.js +++ b/src/profile/elevationComponent.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import * as olEvents from 'ol/events.js'; import ngeoMiscDebounce from 'ngeo/misc/debounce.js'; diff --git a/src/routing/NominatimService.js b/src/routing/NominatimService.js index eeb55ac2d95e..b94f7e4ad359 100644 --- a/src/routing/NominatimService.js +++ b/src/routing/NominatimService.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import ngeoMiscDebounce from 'ngeo/misc/debounce.js'; diff --git a/src/search/createGeoJSONBloodhound.js b/src/search/createGeoJSONBloodhound.js index 7903affa34cf..8632ce489958 100644 --- a/src/search/createGeoJSONBloodhound.js +++ b/src/search/createGeoJSONBloodhound.js @@ -1,4 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ /* global Bloodhound */ import angular from 'angular'; diff --git a/src/statemanager/WfsPermalink.js b/src/statemanager/WfsPermalink.js index d671a8a956ef..1fffb56dd5a3 100644 --- a/src/statemanager/WfsPermalink.js +++ b/src/statemanager/WfsPermalink.js @@ -1,5 +1,3 @@ -/* eslint max-len: ["error", { "code": 110, "ignoreComments": true }] */ - import angular from 'angular'; import {extend as extendExtent, createEmpty as createEmptyExtent} from 'ol/extent.js'; import Feature from 'ol/Feature.js'; diff --git a/test/spec/directives/layertree.spec.js b/test/spec/directives/layertree.spec.js index bacbde822753..78562b9d7a9d 100644 --- a/test/spec/directives/layertree.spec.js +++ b/test/spec/directives/layertree.spec.js @@ -53,6 +53,7 @@ describe('ngeo.layertree.component', () => { $rootScope.$digest(); }); + // @ts-ignore: scope roottreeCtrl = element.scope().layertreeCtrl; }); diff --git a/test/spec/directives/scaleselector.spec.js b/test/spec/directives/scaleselector.spec.js index c7e38f2392e5..fb1bee83ed71 100644 --- a/test/spec/directives/scaleselector.spec.js +++ b/test/spec/directives/scaleselector.spec.js @@ -58,6 +58,7 @@ describe('ngeo.map.scaleselector', () => { } expect(test).not.toThrow(); + // @ts-ignore: scope expect(scope.scaleselectorCtrl.currentScale).toBe(scales[4]); });