Skip to content

Commit 999f4d5

Browse files
committed
#86 Implement no-unused-variable rule
1 parent 81a853c commit 999f4d5

File tree

11 files changed

+39
-62
lines changed

11 files changed

+39
-62
lines changed

src/app/modules/activities-management/components/activity-list/activity-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Input, OnInit } from '@angular/core';
1+
import { OnInit } from '@angular/core';
22
import { Component } from '@angular/core';
33
import { Store, select } from '@ngrx/store';
44

src/app/modules/activities-management/components/create-activity/create-activity.component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { FormBuilder, Validators, FormGroup } from '@angular/forms';
2-
import { Component, Input, EventEmitter, Output } from '@angular/core';
3-
import { Store, select } from '@ngrx/store';
4-
import { Activity } from '../../../shared/models';
2+
import { Component } from '@angular/core';
3+
import { Store } from '@ngrx/store';
54
import { ActivityState } from './../../store/activity-management.reducers';
6-
import { CreateActivity, allActivities } from '../../store';
5+
import { CreateActivity } from '../../store';
76

87
@Component({
98
selector: 'app-create-activity',
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { Component, OnInit } from '@angular/core';
2-
import { ActivityService } from '../services/activity.service';
3-
import { Activity } from '../../shared/models';
42

53
@Component({
64
selector: 'app-activities-management',
75
templateUrl: './activities-management.component.html',
86
styleUrls: ['./activities-management.component.scss'],
97
})
108
export class ActivitiesManagementComponent implements OnInit {
11-
constructor(private activityService: ActivityService) {}
9+
constructor() {}
1210

1311
ngOnInit(): void {}
1412
}

src/app/modules/activities-management/services/activity.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Injectable } from '@angular/core';
2-
import { HttpClient, HttpHeaders } from '@angular/common/http';
2+
import { HttpClient } from '@angular/common/http';
33
import { Observable } from 'rxjs';
44

55
import { environment } from './../../../../environments/environment';

src/app/modules/activities-management/store/activity-management.reducers.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
CreateActivitySuccess,
66
CreateActivityFail,
77
CreateActivity,
8-
DeleteActivity,
98
DeleteActivitySuccess,
109
} from './activity-management.actions';
1110
import { LoadActivitiesSuccess } from './activity-management.actions';

src/app/modules/login/services/azure.ad.b2c.service.spec.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,24 @@ import { UserAgentApplication, Account } from 'msal';
44

55
describe('AzureAdB2CService', () => {
66
let service: AzureAdB2CService;
7-
const msalStub = {
8-
loginPopup() {
9-
return {};
10-
}
11-
};
127

138
beforeEach(() => {
149
TestBed.configureTestingModule({
15-
imports: []
10+
imports: [],
1611
});
1712
service = TestBed.inject(AzureAdB2CService);
1813
});
1914

20-
it('should be created', inject([AzureAdB2CService],
21-
( apiService: AzureAdB2CService) => {
22-
expect(apiService).toBeTruthy();
15+
it('should be created', inject([AzureAdB2CService], (apiService: AzureAdB2CService) => {
16+
expect(apiService).toBeTruthy();
2317
}));
2418

2519
it('on signIn should call msal loginPopup', () => {
26-
spyOn(UserAgentApplication.prototype, 'loginPopup').and.returnValue((
20+
spyOn(UserAgentApplication.prototype, 'loginPopup').and.returnValue(
2721
new Promise((resolve) => {
28-
resolve();
22+
resolve();
2923
})
30-
));
24+
);
3125
service.signIn();
3226
expect(UserAgentApplication.prototype.loginPopup).toHaveBeenCalled();
3327
});
@@ -47,7 +41,7 @@ describe('AzureAdB2CService', () => {
4741
idToken: {},
4842
idTokenClaims: {},
4943
sid: 'abc',
50-
environment: 'abc'
44+
environment: 'abc',
5145
};
5246
spyOn(UserAgentApplication.prototype, 'getAccount').and.returnValues(account);
5347

@@ -66,7 +60,7 @@ describe('AzureAdB2CService', () => {
6660
idToken: {},
6761
idTokenClaims: {},
6862
sid: 'abc',
69-
environment: 'abc'
63+
environment: 'abc',
7064
};
7165
spyOn(UserAgentApplication.prototype, 'getAccount').and.returnValue(account);
7266

@@ -82,5 +76,4 @@ describe('AzureAdB2CService', () => {
8276
expect(UserAgentApplication.prototype.getAccount).toHaveBeenCalled();
8377
expect(isLogin).toEqual(false);
8478
});
85-
8679
});

src/app/modules/reports/pages/reports.component.spec.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ describe('ReportsComponent', () => {
1515

1616
beforeEach(async(() => {
1717
TestBed.configureTestingModule({
18-
declarations: [ ReportsComponent ]
19-
})
20-
.compileComponents();
18+
declarations: [ReportsComponent],
19+
}).compileComponents();
2120
}));
2221

2322
beforeEach(() => {
@@ -30,13 +29,12 @@ describe('ReportsComponent', () => {
3029
expect(component).toBeTruthy();
3130
});
3231

33-
it('should have p tag as \'reports works!\'', async(() => {
32+
it('should have p tag as "reports works!"', async(() => {
3433
// tslint:disable-next-line: no-shadowed-variable
35-
const { app, fixture } = setup();
34+
const { fixture } = setup();
3635
fixture.detectChanges();
3736
const compile = fixture.debugElement.nativeElement;
3837
const ptag = compile.querySelector('p');
3938
expect(ptag.textContent).toBe('reports works!');
4039
}));
41-
4240
});
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component } from '@angular/core';
22
import { interval } from 'rxjs';
33

44
@Component({
55
selector: 'app-clock',
66
templateUrl: './clock.component.html',
7-
styleUrls: ['./clock.component.scss']
7+
styleUrls: ['./clock.component.scss'],
88
})
99
export class ClockComponent {
10-
1110
currentDate: Date = new Date();
1211
hour: number;
1312
minutes: number;
@@ -20,15 +19,15 @@ export class ClockComponent {
2019
setTimeout(() => {
2120
this.displayTime = true;
2221
}, 3000);
23-
}
22+
}
2423

25-
showClock() {
24+
showClock() {
2625
const timenInterval = interval(1000);
27-
timenInterval.subscribe( (data) => {
26+
timenInterval.subscribe((data) => {
2827
this.currentDate = new Date();
2928
this.hour = this.currentDate.getHours();
3029
this.minutes = this.currentDate.getMinutes();
3130
this.seconds = this.currentDate.getSeconds();
3231
});
33-
}
32+
}
3433
}

src/app/modules/shared/pipes/group-by-date/group-by-date.pipe.spec.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { GroupByDatePipe } from './group-by-date.pipe';
2-
import { Pipe } from '@angular/core';
32

43
describe('GroupByDatePipe', () => {
54
it('create an instance', () => {
@@ -24,7 +23,7 @@ describe('GroupByDatePipe', () => {
2423
activity: 'development',
2524
technology: 'Angular, TypeScript',
2625
comments: 'No comments',
27-
ticket: 'EY-25'
26+
ticket: 'EY-25',
2827
},
2928
{
3029
id: 'entry_2',
@@ -34,7 +33,7 @@ describe('GroupByDatePipe', () => {
3433
activity: 'development',
3534
technology: 'Angular, TypeScript',
3635
comments: 'No comments',
37-
ticket: 'EY-38'
36+
ticket: 'EY-38',
3837
},
3938
{
4039
id: 'entry_3',
@@ -44,7 +43,7 @@ describe('GroupByDatePipe', () => {
4443
activity: 'development',
4544
technology: 'Angular, TypeScript',
4645
comments: 'No comments',
47-
ticket: 'EY-225'
46+
ticket: 'EY-225',
4847
},
4948
{
5049
id: 'entry_4',
@@ -54,7 +53,7 @@ describe('GroupByDatePipe', () => {
5453
activity: 'development',
5554
technology: 'Angular, TypeScript',
5655
comments: 'No comments',
57-
ticket: 'EY-89'
56+
ticket: 'EY-89',
5857
},
5958
{
6059
id: 'entry_5',
@@ -64,8 +63,8 @@ describe('GroupByDatePipe', () => {
6463
activity: 'development',
6564
technology: 'Angular, TypeScript',
6665
comments: 'No comments',
67-
ticket: 'EY-59'
68-
}
66+
ticket: 'EY-59',
67+
},
6968
];
7069
const pipe = new GroupByDatePipe();
7170
const result = pipe.transform(entryList);

src/app/modules/time-entries/pages/time-entries.component.spec.ts

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
MonthPickerComponent,
66
DetailsFieldsComponent,
77
EmptyStateComponent,
8-
ModalComponent
8+
ModalComponent,
99
} from '../../shared/components';
1010
import { GroupByDatePipe } from '../../shared/pipes';
1111
import { TimeEntriesComponent } from './time-entries.component';
@@ -21,16 +21,9 @@ describe('TimeEntriesComponent', () => {
2121
activity: 'development',
2222
technology: 'Angular, TypeScript',
2323
comments: 'No comments',
24-
ticket: 'EY-25'
24+
ticket: 'EY-25',
2525
};
2626

27-
function setup() {
28-
// tslint:disable-next-line: no-shadowed-variable
29-
const fixture = TestBed.createComponent(TimeEntriesComponent);
30-
const app = fixture.debugElement.componentInstance;
31-
return { fixture, app };
32-
}
33-
3427
beforeEach(async(() => {
3528
TestBed.configureTestingModule({
3629
declarations: [
@@ -39,14 +32,10 @@ describe('TimeEntriesComponent', () => {
3932
GroupByDatePipe,
4033
ModalComponent,
4134
MonthPickerComponent,
42-
TimeEntriesComponent
35+
TimeEntriesComponent,
4336
],
44-
imports: [
45-
FormsModule,
46-
ReactiveFormsModule
47-
]
48-
})
49-
.compileComponents();
37+
imports: [FormsModule, ReactiveFormsModule],
38+
}).compileComponents();
5039
}));
5140

5241
beforeEach(() => {

0 commit comments

Comments
 (0)