Skip to content

Commit beb6578

Browse files
committed
Update tslint rules with Angular-specific rules, adjust other rules.
1 parent 060c01a commit beb6578

22 files changed

Lines changed: 91 additions & 48 deletions

src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h2>Sky View Café NP</h2>
5757
</div>
5858
</div>
5959
<div class="lower-panel flex-container" fxFlex="100%" fxLayout="row" fxLayoutAlign="start stretch" fxLayoutGap="4px">
60-
<ks-tab-view fxFlex="1 0 auto" (onChange)="tabChanged($event)" [activeTab]="selectedTab">
60+
<ks-tab-view fxFlex="1 0 auto" (change)="tabChanged($event)" [activeTab]="selectedTab">
6161
<ks-tab header="Sky">
6262
<svc-sky-view></svc-sky-view>
6363
</ks-tab>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright © 2017-2018 Kerry Shetline, kerry@shetline.com.
2+
Copyright © 2017-2019 Kerry Shetline, kerry@shetline.com.
33
44
This code is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -152,6 +152,7 @@ const PLANET_EXTRA_SPAN = 2;
152152
const STAR_REDUCED_SPAN = 2;
153153
export const FAR_AWAY = 999999;
154154

155+
// tslint:disable-next-line:variable-name
155156
const DIMMEST_AT_SCALE_1x1_STAR_IMAGE_INDEX = 100;
156157

157158
const opacitiesOfWhite: string[] = [];

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,14 @@ export const BRIGHT_STAR_LIMIT = 1.5;
5353
// stars anyway because of its importance for orientation.
5454
export const POLARIS_FK5_NUM = 907;
5555

56+
// tslint:disable-next-line:variable-name
5657
const SCALE_WHERE_BRIGHTEST_STAR_IS_3x3 = 0.0026;
58+
// tslint:disable-next-line:variable-name
5759
const DIMMEST_ALLOWED_1x1_STAR_IMAGE_INDEX = 33;
5860
// const DIMMEST_AT_SCALE_1x1_STAR_IMAGE_INDEX = 100;
61+
// tslint:disable-next-line:variable-name
5962
const BRIGHTEST_1x1_STAR_IMAGE_INDEX = 500;
63+
// tslint:disable-next-line:variable-name
6064
const BRIGHTEST_3x3_STAR_IMAGE_INDEX = 1500;
6165

6266
const opacitiesOfWhite: string[] = [];

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export class SvcChangeLocationDialogComponent {
3434
private _visible = false;
3535
private _latitude: number;
3636
private _longitude: number;
37-
private _timezone;
37+
private _timezone: string;
3838
private hourOffset: number;
3939

4040
formattedLatitude: string;
4141
formattedLongitude: string;
4242
formattedHourOffset: string;
4343
zoneChoice = '0';
44-
currentZone;
44+
currentZone: string;
4545

4646
@Input() get visible(): boolean { return this._visible; }
4747
set visible(isVisible: boolean) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright © 2017-2018 Kerry Shetline, kerry@shetline.com.
2+
Copyright © 2017-2019 Kerry Shetline, kerry@shetline.com.
33
44
This code is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by

src/app/svc/svc-generic-options.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class SvcGenericOptionsComponent {
3838
{label: 'All asteroids and comets', value: ADDITIONALS.ALL}
3939
];
4040

41-
constructor(protected appService: AppService, protected viewName) {
41+
constructor(protected appService: AppService, protected viewName: string) {
4242
this.asteroidsReady = appService.asteroidsReady;
4343

4444
if (!this.asteroidsReady) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class SvcInsolationViewComponent extends GenericView implements AfterView
183183
let y0 = this.lastPlotY;
184184
let timedOut = false;
185185

186-
outerLoop:
186+
outerLoop:
187187
for (let plotSize = this.lastPlotSize; plotSize >= 1; plotSize /= 2) {
188188
for (let y = y0; y < this.daysInYear; y += plotSize) {
189189
let time_jdu = this.baseTime + y + 2.5 / MINS_PER_DAY - 5.0 / MINS_PER_DAY * plotSize;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright © 2017 Kerry Shetline, kerry@shetline.com.
2+
Copyright © 2017-2019 Kerry Shetline, kerry@shetline.com.
33
44
This code is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -86,8 +86,8 @@ export class SvcMapViewComponent extends GenericView implements AfterViewInit {
8686

8787
private xOffset: number;
8888
private mapYOffset: number;
89-
private mapWidth;
90-
private mapHeight;
89+
private mapWidth: number;
90+
private mapHeight: number;
9191
private moonShadowPts: number[];
9292
private lastSunLatitude = 0;
9393
private lastSunLongitude = 0;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export class SvcMoonsViewComponent extends GenericPlanetaryView implements After
218218
let planetShown = false;
219219
let colorOfMoon: string = null;
220220
const pt = <Point> {};
221-
let number = '', name = '', longName = '';
221+
let num = '', name = '', longName = '';
222222
let transitNames = '';
223223
let offscreenNames = '';
224224
let eclipsedNames = '';
@@ -252,9 +252,9 @@ export class SvcMoonsViewComponent extends GenericPlanetaryView implements After
252252
for (let i = 0; i <= moons.length; ++i) {
253253
if (i < moons.length) {
254254
pos = moons[i];
255-
number = PlanetaryMoons.getMoonNumber(pos.moonIndex);
255+
num = PlanetaryMoons.getMoonNumber(pos.moonIndex);
256256
name = PlanetaryMoons.getMoonName(pos.moonIndex);
257-
longName = name + ' (' + number + ')';
257+
longName = name + ' (' + num + ')';
258258
drawMoon = true;
259259
hidden = false;
260260

@@ -372,7 +372,7 @@ export class SvcMoonsViewComponent extends GenericPlanetaryView implements After
372372
if (this.moonNumbers && this.moonNames)
373373
name = longName;
374374
else if (this.moonNumbers)
375-
name = number;
375+
name = num;
376376

377377
const li = {name: name, pt: pt, labelType: hidden ? LABEL_TYPE.HIDDEN_MOON : LABEL_TYPE.MOON, bodyIndex: pos.moonIndex};
378378
this.addLabel(li, dc);

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ enum DrawingMode { FULL_COLOR, LEFT_EYE, RIGHT_EYE }
8585
const orbitColors: string[][] = [];
8686
const SHADES = 50;
8787

88-
(function(): void {
88+
((): void => {
8989
for (let i = 0; i < planetColors.length + 4; ++i) {
9090
const shades = [];
9191
let rgb: RGBA;
@@ -265,9 +265,7 @@ export class SvcOrbitViewComponent extends GenericPlanetaryView implements After
265265
const orbitStep = 1.0;
266266
this.zBuffer.clear();
267267

268-
for (let i = 0; i < this.planetsToDraw.length; ++i) {
269-
const planet = this.planetsToDraw[i];
270-
268+
for (const planet of this.planetsToDraw) {
271269
// Don't draw an orbit for the Sun.
272270
if (planet === SUN)
273271
continue;
@@ -448,9 +446,7 @@ export class SvcOrbitViewComponent extends GenericPlanetaryView implements After
448446

449447
let positions: ZSortablePlanet[] = [];
450448

451-
for (let i = 0; i < this.planetsToDraw.length; ++i) {
452-
const planet = this.planetsToDraw[i];
453-
449+
for (const planet of this.planetsToDraw) {
454450
pt0 = dc.ss.getHeliocentricPosition(planet, dc.jde).xyz;
455451
SvcOrbitViewComponent.translate(mode, pt0, ctr, viewingDistance, cos_xz, sin_xz, cos_yz, sin_yz);
456452

0 commit comments

Comments
 (0)