Skip to content

Commit

Permalink
Implements no-unused-variable tslint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Hollie Lambert authored and Hollie Lambert committed Feb 8, 2019
1 parent 603d21e commit 598745b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { NavigationEnd, Router } from '@angular/router';
})
export class AppComponent implements OnInit {
constructor(
private angulartics2GoogleTagManager: Angulartics2GoogleAnalytics,
private angulartics2Intercom: Angulartics2Intercom,
// tslint:disable:no-unused-variable
private angulartics2GoogleTagManager: Angulartics2GoogleAnalytics, private angulartics2Intercom: Angulartics2Intercom,
private router: Router
) { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Store } from '@ngrx/store';
import { RubricsStateInterface } from '../../store/rubrics.state';
import { ComponentInterface } from '../../object-interfaces/component.interface';
import { BaseEditRubricComponent } from '../base/base-edit-rubric.component';
import { emptyComponentObject } from '../../data-services/data/empty-component.object';
import { LevelInterface } from '../../object-interfaces/level.interface';

@Component({
Expand All @@ -28,12 +27,12 @@ export class EditRubricTableBodyComponent extends BaseEditRubricComponent {
}

public componentWidth(): object {
return {'min-width': '15em'};
return { 'min-width': '15em' };
}

public removeComponent(componentIndex: number): void {
if (this.rubric !== undefined && this.rubric.components !== undefined) {
this.rubric.components = this.rubric.components.filter((c, i) => i !== componentIndex);
this.rubric.components = this.rubric.components.filter((c, i) => i !== componentIndex);
this.updateRubric();
}
}
Expand All @@ -54,7 +53,7 @@ export class EditRubricTableBodyComponent extends BaseEditRubricComponent {
this.rubric.components[componentIndex].levels.length > 0
) {
this.rubric.components[componentIndex].levels = this.rubric.components[componentIndex].levels
.filter((c, i) => i !== levelIndex);
.filter((c, i) => i !== levelIndex);
this.updateRubric();
}
}
Expand All @@ -64,7 +63,7 @@ export class EditRubricTableBodyComponent extends BaseEditRubricComponent {
this.rubric !== undefined && this.rubric.components !== undefined &&
this.rubric.components[componentIndex].levels.length > 0
) {
return {...this.rubric.components[componentIndex].levels[levelIndex - 1]};
return { ...this.rubric.components[componentIndex].levels[levelIndex - 1] };
}

return {};
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/page-alert/page-alert.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BaseComponent } from '../base/base.component';
import { Router } from '@angular/router';
import { selectError } from '../../store/rubrics.selectors';
import { DisplayableErrorInterface } from '../../object-interfaces/displayable-error.interface';
import { filter, takeUntil, tap } from 'rxjs/operators';
import { filter, takeUntil } from 'rxjs/operators';

@Component({
selector: 'rc-page-alert',
Expand Down
1 change: 0 additions & 1 deletion src/app/containers/view-rubric/view-rubric.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { GetRubric, SetPageTitle } from '../../store/rubrics.actions';
import { BaseRubricComponent } from '../../components/base/base-rubric.component';
import { selectCurrentRubric, selectPageTitle } from '../../store/rubrics.selectors';
import { combineLatest } from 'rxjs/internal/observable/combineLatest';
import { RubricInterface } from '../../object-interfaces/rubric.interface';
import { filter, map, takeUntil, tap } from 'rxjs/operators';

@Component({
Expand Down
14 changes: 7 additions & 7 deletions src/app/data-services/backend-data.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ describe('BackendDataService', () => {
spyOn(mockLocalStorageService, 'getRubrics').and.callThrough();
spyOn(mockJsonbinHttpService, 'getRubric').and.callThrough();

const results = service.getRubric(uuid);
service.getRubric(uuid);

expect(mockLocalStorageService.getRubrics).toHaveBeenCalledTimes(1);
expect(mockJsonbinHttpService.getRubric).toHaveBeenCalledTimes(1);
void expect(mockLocalStorageService.getRubrics).toHaveBeenCalledTimes(1);
void expect(mockJsonbinHttpService.getRubric).toHaveBeenCalledTimes(1);
}
));

Expand All @@ -49,9 +49,9 @@ describe('BackendDataService', () => {
(service: BackendDataService) => {
spyOn(mockLocalStorageService, 'getRubrics').and.callThrough();

const results = service.getRubrics();
service.getRubrics();

expect(mockLocalStorageService.getRubrics).toHaveBeenCalledTimes(1);
void expect(mockLocalStorageService.getRubrics).toHaveBeenCalledTimes(1);
}
));

Expand All @@ -63,9 +63,9 @@ describe('BackendDataService', () => {
name: faker.lorem.words(),
};

const result = service.createRubric(rubric);
service.createRubric(rubric);

expect(mockJsonbinHttpService.createRubric).toHaveBeenCalledTimes(1);
void expect(mockJsonbinHttpService.createRubric).toHaveBeenCalledTimes(1);
}
));
});
10 changes: 5 additions & 5 deletions src/app/services/connection.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { async, fakeAsync, inject, TestBed, tick } from '@angular/core/testing';
import { fakeAsync, inject, TestBed } from '@angular/core/testing';
import { ConnectionService } from './connection.service';
import { Store, StoreModule } from '@ngrx/store';
import { getInitialState, RubricsStateInterface } from '../store/rubrics.state';
Expand All @@ -7,7 +7,7 @@ import { WindowRef } from './window-ref.service';
import { NavigatorRef } from './navigator-ref.service';

describe('ConnectionService', () => {
let testNavigator = {nativeNavigator: {onLine: true}};
let testNavigator = { nativeNavigator: { onLine: true } };
let store: Store<RubricsStateInterface>;

beforeEach(() => {
Expand All @@ -22,8 +22,8 @@ describe('ConnectionService', () => {
],
imports: [
StoreModule.forRoot(
{rubrics: rubricsReducer},
{initialState: getInitialState}
{ rubrics: rubricsReducer },
{ initialState: getInitialState }
),
],
});
Expand All @@ -40,6 +40,6 @@ describe('ConnectionService', () => {
testNavigator.nativeNavigator.onLine = false;
service.init();

expect(store.dispatch).toHaveBeenCalledTimes(2);
void expect(store.dispatch).toHaveBeenCalledTimes(2);
})));
});
1 change: 1 addition & 0 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
"no-unsafe-finally": true,
"no-unused-css": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-void-expression": [
Expand Down

0 comments on commit 598745b

Please sign in to comment.