Skip to content

Commit 46b1047

Browse files
DanielHabenichtrestyled-io[bot]restyled-commits
authored
chore(lint): change linting (#613)
* chore(lint): change linting fixes #600 * add some more options to change impacts #169 * reset values to standard * remove warnings * add tslint to workspace * auto fix * add better tslint rules * fix some tslint errors * Restyled by prettier (#621) Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 6923798 commit 46b1047

File tree

12 files changed

+31
-104
lines changed

12 files changed

+31
-104
lines changed

Phonebook.Frontend/src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class AppComponent implements OnInit, OnDestroy {
133133

134134
if (
135135
DisplayNotificationDialog.version >
136-
(this.store.selectSnapshot(AppState.displayedNotificationVersion) | 0)
136+
(this.store.selectSnapshot(AppState.displayedNotificationVersion) || 0)
137137
) {
138138
this.matDialog.open(DisplayNotificationDialog, {
139139
height: '90vh',

Phonebook.Frontend/src/app/modules/feature-flag/feature-flag.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class FeatureFlagService {
3838
* @param flag The name of the Flag specfied in the FeatureFlags.json
3939
*/
4040
public get(flag: string): Observable<boolean> {
41-
return combineLatest(this.getFlags(), this.flagOverwriteEmitter.pipe(startWith(0))).pipe(
41+
return combineLatest([this.getFlags(), this.flagOverwriteEmitter.pipe(startWith(0))]).pipe(
4242
map(([flags, emitter]) => {
4343
return this.isEnabled(flag, flags[flag]);
4444
}),
@@ -113,6 +113,6 @@ export class FeatureFlagService {
113113

114114
public static isFirstApril(date: Date): boolean {
115115
const firstApril = new Date('2020-04-01T00:00:00');
116-
return date.getDate() == firstApril.getDate() && date.getMonth() == firstApril.getMonth();
116+
return date.getDate() === firstApril.getDate() && date.getMonth() === firstApril.getMonth();
117117
}
118118
}

Phonebook.Frontend/src/app/modules/profile-picture/components/change-profile-picture/change-profile-picture.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ export class mockCurrentUserService {
5252
template: '<app-change-profile-picture [userId]="id"></app-change-profile-picture>',
5353
})
5454
class TestComponentWrapper {
55-
public id = 'test';
55+
public id: string = 'test';
5656
}

Phonebook.Frontend/src/app/modules/profile-picture/components/change-profile-picture/change-profile-picture.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class ChangeProfilePictureComponent implements OnInit {
1616
@Input()
1717
public userId: string;
1818
public currentUserId: string = '';
19-
public uploading = false;
19+
public uploading: boolean = false;
2020

2121
constructor(
2222
private profilePictureService: ProfilePictureService,
@@ -47,7 +47,9 @@ export class ChangeProfilePictureComponent implements OnInit {
4747
.subscribe((upload) => {
4848
if (upload) {
4949
this.uploading = true;
50-
// This is import because of firefox https://stackoverflow.com/questions/5301643/how-can-i-make-event-srcelement-work-in-firefox-and-what-does-it-mean
50+
// This is important because of firefox
51+
// https://stackoverflow.com/questions/5301643/how-can-i-make-event-srcelement-work-in-firefox-and-what-does-it-mean
52+
// tslint:disable-next-line
5153
const eventElement = event.target || event.srcElement;
5254
const files = (eventElement as HTMLInputElement).files;
5355
if (files != null && files.length > 0) {

Phonebook.Frontend/src/app/modules/profile-picture/components/profile-picture/profile-picture.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class ProfilePictureComponent implements OnInit, OnDestroy {
6666
});
6767
}
6868
private getAprilProfilePictureUrl() {
69-
var random = Math.floor(Math.random() * Math.floor(9));
69+
const random = Math.floor(Math.random() * Math.floor(9));
7070
switch (random) {
7171
case 0:
7272
return 'assets/img/firstApril/unicorn_1.png';

Phonebook.Frontend/src/app/shared/components/address/address.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,5 @@ export class AddressComponent implements OnInit {
1515
return this.location.RoomCollection[0].Description.split(',');
1616
}
1717

18-
constructor() {}
19-
2018
public ngOnInit() {}
2119
}

Phonebook.Frontend/src/environments/runtime-environment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* tslint:disable:no-invalid-template-strings */
12
import { Environment, RuntimeEnvironmentInterface } from 'src/environments/EnvironmentInterfaces';
23

34
declare const ENV: RuntimeEnvironmentInterface;

Phonebook.Frontend/src/polyfills.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* tslint:disable:no-import-side-effect */
12
/**
23
* This file includes polyfills needed by Angular and is loaded before the app.
34
* You can add your own extra polyfills to this file.

Phonebook.Frontend/src/test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* tslint:disable:no-import-side-effect */
12
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
23

34
import 'zone.js/dist/long-stack-trace-zone';
@@ -17,6 +18,7 @@ declare const __karma__: any;
1718
declare const require: any;
1819

1920
// Prevent Karma from running prematurely.
21+
// tslint:disable-next-line
2022
__karma__.loaded = function () {};
2123

2224
// First, initialize the Angular testing environment.

Phonebook.Frontend/tsconfig.app.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"types": ["node"],
66
"strict": true,
77
"strictNullChecks": true,
8-
"noImplicitAny": false
8+
"noImplicitAny": false,
9+
"noUnusedLocals": false,
10+
"noUnusedParameters": false
911
},
1012
"angularCompilerOptions": {
1113
"fullTemplateTypeCheck": true,

0 commit comments

Comments
 (0)