Skip to content

Commit 16eb529

Browse files
committed
More clean up of code warnings.
1 parent 7deec9f commit 16eb529

33 files changed

Lines changed: 70 additions & 46 deletions

e2e/app.po.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// noinspection ES6UnusedImports
12
import { browser, by, element } from 'protractor';
23

34
export class AppPage {

protractor.conf.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ exports.config = {
1717
jasmineNodeOpts: {
1818
showColors: true,
1919
defaultTimeoutInterval: 30000,
20-
print: function() {}
20+
"print": function() {}
2121
},
22-
onPrepare() {
22+
"onPrepare": () => {
2323
require('ts-node').register({
2424
project: 'e2e/tsconfig.e2e.json'
2525
});
26+
// noinspection JSCheckFunctionSignatures
2627
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
2728
}
2829
};

src/app/app.service.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ export class AppService {
119119
private defaultLocation: Location = new Location('(Greenwich Observatory)', 51.47, 0, 'UT');
120120
private _location = new BehaviorSubject<Location>(this.defaultLocation);
121121
private locationObserver: Observable<Location> = this._location.asObservable();
122-
private _locations: Location[] = [];
122+
private readonly _locations: Location[] = [];
123123
private _solarSystem = new SolarSystem();
124-
private _starCatalog: StarCatalog;
124+
private readonly _starCatalog: StarCatalog;
125125
private _starsReady = new BehaviorSubject<boolean>(false);
126126
private starsReadyObserver: Observable<boolean> = this._starsReady.asObservable();
127127
private _asteroidsReady = new BehaviorSubject<boolean>(false);
@@ -130,8 +130,8 @@ export class AppService {
130130
private currentTabObserver: Observable<CurrentTab> = this._currentTab.asObservable();
131131
private settingsSource = new Subject<UserSetting>();
132132
private settingsObserver: Observable<UserSetting> = this.settingsSource.asObservable();
133-
private allSettings: {[view: string]: {[setting: string]: boolean | number | string}} = {};
134-
private debouncedSaveSettings: () => void;
133+
private readonly allSettings: {[view: string]: {[setting: string]: boolean | number | string}} = {};
134+
private readonly debouncedSaveSettings: () => void;
135135
private knownIanaTimezones: Set<string>;
136136
private _northAzimuth = false;
137137
private _defaultTab = CurrentTab.SKY;
@@ -143,9 +143,9 @@ export class AppService {
143143
private _nativeDateTime = false;
144144
private _showNativeInputDialog = false;
145145
private _warningNativeDateTime = false;
146-
private hostname: string;
147-
private port: number;
148-
private localTesting: boolean;
146+
private readonly hostname: string;
147+
private readonly port: number;
148+
private readonly localTesting: boolean;
149149

150150
constructor(astroDataService: AstroDataService, private httpClient: HttpClient, private _sanitizer: DomSanitizer,
151151
private router: Router) {
@@ -314,6 +314,7 @@ export class AppService {
314314
set currentTab(newTab: CurrentTab) {
315315
if (this._currentTab.getValue() !== newTab) {
316316
this._currentTab.next(newTab);
317+
// noinspection JSIgnoredPromiseFromCall
317318
this.router.navigate(['/' + tabNames[this._currentTab.getValue()]]);
318319
}
319320
}

src/app/svc/generic-planetary-view.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export abstract class GenericPlanetaryViewDirective extends GenericViewDirective
179179
protected topocentricMoon = false;
180180
protected northAzimuth = false;
181181

182-
constructor(protected appService: AppService, protected tabId: CurrentTab) {
182+
protected constructor(protected appService: AppService, protected tabId: CurrentTab) {
183183
super(appService, tabId);
184184

185185
this.brightenStars(false);

src/app/svc/generic-sky-view.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export abstract class GenericSkyViewDirective extends GenericPlanetaryViewDirect
8080
protected showConstellations = false;
8181
protected showDimStars = false;
8282

83-
constructor(appService: AppService, tabId: CurrentTab) {
83+
protected constructor(appService: AppService, tabId: CurrentTab) {
8484
super(appService, tabId);
8585
}
8686

@@ -139,7 +139,7 @@ export abstract class GenericSkyViewDirective extends GenericPlanetaryViewDirect
139139
if (!pt)
140140
break;
141141

142-
if (!breakLine)
142+
if (!breakLine) // noinspection JSUnusedAssignment
143143
outOfView = outOfView || !this.drawSkyPlotLine(pt, lastPt, dc, NONPLANET.CONSTELLATIONS);
144144

145145
if (nextIsAnchor) {

src/app/svc/generic-view.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ export abstract class GenericViewDirective implements AfterViewInit {
368368
}
369369

370370
onMouseMove(event: MouseEvent): void {
371-
if (this.goodDragStart || !this.dragging)
371+
if (this.goodDragStart || !this.dragging) // noinspection JSDeprecatedSymbols (for `which`)
372372
this.handleMouseMove(event.offsetX, event.offsetY, !!((event.buttons & 0x01) || (this.isSafari && (event.which & 0x01))));
373373
}
374374

src/app/svc/planet-drawer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export abstract class PlanetDrawer {
3939
protected w2: number;
4040
protected h2: number;
4141

42-
constructor(protected baseImage: HTMLImageElement, protected flattening: number, protected defaultColor: string) {
42+
protected constructor(protected baseImage: HTMLImageElement, protected flattening: number, protected defaultColor: string) {
4343
if (baseImage) {
4444
this.scaledCylinderCanvas = <HTMLCanvasElement> <any> document.createElement('canvas');
4545
this.scaledCylinderCanvas.width = 1;
@@ -55,10 +55,12 @@ export abstract class PlanetDrawer {
5555
return 0.0;
5656
}
5757

58+
// noinspection JSUnusedGlobalSymbols
5859
hasImage(): boolean {
5960
return !!this.baseImage;
6061
}
6162

63+
// noinspection JSUnusedGlobalSymbols
6264
resetCachedTime(): void {
6365
this.lastTime = Number.MAX_VALUE;
6466
}

src/app/svc/svc-atlas.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ export class SvcAtlasService {
7070
private static states: string[];
7171
private static statesPromise: Promise<string[]>;
7272

73-
private hostname: string;
74-
private port: number;
75-
private localTesting: boolean;
73+
private readonly hostname: string;
74+
private readonly port: number;
75+
private readonly localTesting: boolean;
7676
private lastPing = -Number.MAX_SAFE_INTEGER;
7777

7878
constructor(private httpClient: HttpClient) {

src/app/svc/svc-calendar-view/svc-calendar-view.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class SvcCalendarViewComponent implements AfterViewInit {
108108
private equisolstice = true;
109109
private dailyMoonPhase = true;
110110
private dailyDaylight = true;
111-
private throttledResize: () => void;
111+
private readonly throttledResize: () => void;
112112
private eventFinder = new EventFinder();
113113
private moonDrawer: MoonDrawer;
114114

src/app/svc/svc-change-location-dialog/svc-change-location-dialog.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export class SvcChangeLocationDialogComponent {
105105
}
106106

107107
onKey(event: KeyboardEvent): void {
108+
// noinspection JSDeprecatedSymbols (for `keyCode`)
108109
if (event.keyCode === 13)
109110
this.goToLocation();
110111
}

0 commit comments

Comments
 (0)