diff --git a/.eslintrc.json b/.eslintrc.json index 9f0051c9..1ddbe661 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -16,9 +16,9 @@ "createDefaultProgram": true }, "extends": [ - "plugin:@angular-eslint/ng-cli-compat", - "plugin:@angular-eslint/ng-cli-compat--formatting-add-on", - "plugin:@angular-eslint/template/process-inline-templates" + "plugin:@angular-eslint/recommended", + "plugin:@angular-eslint/template/process-inline-templates", + "plugin:@typescript-eslint/recommended" ], "rules": { "jsdoc/newline-after-description": "off", diff --git a/projects/ngx-openlayers/src/lib/collectioncoordinates.component.ts b/projects/ngx-openlayers/src/lib/collectioncoordinates.component.ts index 574f69d2..cfc45431 100644 --- a/projects/ngx-openlayers/src/lib/collectioncoordinates.component.ts +++ b/projects/ngx-openlayers/src/lib/collectioncoordinates.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnChanges, OnInit, Optional, SimpleChanges } from '@angular/core'; +import { Component, Input, OnChanges, OnInit, Optional } from '@angular/core'; import { Coordinate } from 'ol/coordinate'; import { transform } from 'ol/proj'; import { GeometryLinestringComponent } from './geom/geometrylinestring.component'; @@ -50,7 +50,7 @@ export class CollectionCoordinatesComponent implements OnChanges, OnInit { this.transformCoordinates(); } - ngOnChanges(changes: SimpleChanges): void { + ngOnChanges(): void { this.transformCoordinates(); } diff --git a/projects/ngx-openlayers/src/lib/coordinate.component.ts b/projects/ngx-openlayers/src/lib/coordinate.component.ts index 7276bd57..f877761f 100644 --- a/projects/ngx-openlayers/src/lib/coordinate.component.ts +++ b/projects/ngx-openlayers/src/lib/coordinate.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnChanges, OnInit, Optional, SimpleChanges } from '@angular/core'; +import { Component, Input, OnChanges, OnInit, Optional } from '@angular/core'; import { transform } from 'ol/proj'; import { GeometryCircleComponent } from './geom/geometrycircle.component'; import { GeometryPointComponent } from './geom/geometrypoint.component'; @@ -46,7 +46,7 @@ export class CoordinateComponent implements OnChanges, OnInit { this.transformCoordinates(); } - ngOnChanges(changes: SimpleChanges): void { + ngOnChanges(): void { this.transformCoordinates(); } diff --git a/projects/ngx-openlayers/src/lib/feature.component.ts b/projects/ngx-openlayers/src/lib/feature.component.ts index 47a9e54c..0348f474 100644 --- a/projects/ngx-openlayers/src/lib/feature.component.ts +++ b/projects/ngx-openlayers/src/lib/feature.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; +import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { Feature } from 'ol'; import { SourceVectorComponent } from './sources/vector.component'; @@ -27,7 +27,7 @@ export class FeatureComponent implements OnInit, OnDestroy, OnChanges { this.host.instance.removeFeature(this.instance); } - ngOnChanges(changes: SimpleChanges): void { + ngOnChanges(): void { if (this.instance) { this.instance.setId(this.id); } diff --git a/projects/ngx-openlayers/src/lib/graticule.component.ts b/projects/ngx-openlayers/src/lib/graticule.component.ts index 5e573fac..28725c81 100644 --- a/projects/ngx-openlayers/src/lib/graticule.component.ts +++ b/projects/ngx-openlayers/src/lib/graticule.component.ts @@ -17,7 +17,7 @@ export class GraticuleComponent implements AfterContentInit, OnChanges, OnDestro @Input() latLabelPosition: number; - instance: any; + instance: Graticule; componentType = 'graticule'; constructor(private map: MapComponent) {} diff --git a/projects/ngx-openlayers/src/lib/sources/source.component.ts b/projects/ngx-openlayers/src/lib/sources/source.component.ts index c4ac82f7..341985d6 100644 --- a/projects/ngx-openlayers/src/lib/sources/source.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/source.component.ts @@ -2,11 +2,12 @@ import { Directive, Input, OnDestroy } from '@angular/core'; import { Source } from 'ol/source'; import { LayerComponent } from '../layers/layer.component'; +import { AttributionLike } from 'ol/source/Source'; @Directive() export abstract class SourceComponent implements OnDestroy { @Input() - attributions: any; + attributions: AttributionLike; public instance: Source; public componentType = 'source'; diff --git a/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts b/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts index 1aa9bca6..430280d1 100644 --- a/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts +++ b/projects/ngx-openlayers/src/lib/sources/tilewmts.component.ts @@ -19,6 +19,7 @@ import { LayerTileComponent } from '../layers/layertile.component'; import { TileGridWMTSComponent } from '../tilegridwmts.component'; import { SourceComponent } from './source.component'; import { RequestEncoding } from 'ol/source/WMTS'; +import { ImageTile } from 'ol'; @Component({ selector: 'aol-source-tilewmts', @@ -43,7 +44,7 @@ export class SourceTileWMTSComponent extends SourceComponent implements AfterCon @Input() style: string; @Input() - tileClass?: any; + tileClass?: typeof ImageTile; @Input() tilePixelRatio?: number; @Input() diff --git a/projects/ngx-openlayers/src/lib/tilegrid.component.ts b/projects/ngx-openlayers/src/lib/tilegrid.component.ts index 47d689b6..f73d067c 100644 --- a/projects/ngx-openlayers/src/lib/tilegrid.component.ts +++ b/projects/ngx-openlayers/src/lib/tilegrid.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; +import { Component, Input, OnChanges, OnInit } from '@angular/core'; import { createXYZ } from 'ol/tilegrid'; import TileGrid from 'ol/tilegrid/TileGrid'; import { Extent } from 'ol/extent'; @@ -33,7 +33,7 @@ export class TileGridComponent implements OnInit, OnChanges { } } - ngOnChanges(changes: SimpleChanges): void { + ngOnChanges(): void { if (!this.resolutions) { this.instance = createXYZ(this); } else { diff --git a/src/app/display-geojson-source/display-geojson-source.component.ts b/src/app/display-geojson-source/display-geojson-source.component.ts index 7098824d..8058fa30 100644 --- a/src/app/display-geojson-source/display-geojson-source.component.ts +++ b/src/app/display-geojson-source/display-geojson-source.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'app-display-geojson-source', diff --git a/src/app/swipe/swipe.component.ts b/src/app/swipe/swipe.component.ts index 3a25bde1..e7b4fe9e 100644 --- a/src/app/swipe/swipe.component.ts +++ b/src/app/swipe/swipe.component.ts @@ -74,7 +74,7 @@ export class SwipeComponent implements OnInit { paddingSize = 16; @HostListener('window:resize', ['$event']) - onWindowResize(event): void { + onWindowResize(): void { this.resetSwipeValues(); } diff --git a/src/app/tile-json/tile-json.component.ts b/src/app/tile-json/tile-json.component.ts index 0f63717d..ce5c9df2 100644 --- a/src/app/tile-json/tile-json.component.ts +++ b/src/app/tile-json/tile-json.component.ts @@ -16,6 +16,4 @@ import { Component } from '@angular/core'; `, }) -export class TileJsonComponent { - constructor() {} -} +export class TileJsonComponent {}