diff --git a/projects/ngx-debounce-click/src/ngx-debounce-click.directive.spec.ts b/projects/ngx-debounce-click/src/ngx-debounce-click.directive.spec.ts index b7f6abd..ab2efea 100644 --- a/projects/ngx-debounce-click/src/ngx-debounce-click.directive.spec.ts +++ b/projects/ngx-debounce-click/src/ngx-debounce-click.directive.spec.ts @@ -38,7 +38,7 @@ describe('NgxDebounceClickDirective', () => { button = fixture.nativeElement.querySelector('button'); })); - it('should debounce a click event', fakeAsync(done => { + it('should debounce a click event', fakeAsync(() => { expect(component.count).toBe(0); button.click(); expect(component.count).toBe(0); diff --git a/projects/ngx-debounce-click/src/ngx-debounce-click.directive.ts b/projects/ngx-debounce-click/src/ngx-debounce-click.directive.ts index 944ede9..a43fb53 100644 --- a/projects/ngx-debounce-click/src/ngx-debounce-click.directive.ts +++ b/projects/ngx-debounce-click/src/ngx-debounce-click.directive.ts @@ -3,13 +3,10 @@ import { EventEmitter, HostListener, Input, - Inject, OnInit, OnDestroy, - Output, - PLATFORM_ID + Output } from '@angular/core'; -import { isPlatformBrowser } from '@angular/common'; import { Subject, Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; @@ -21,11 +18,6 @@ export class NgxDebounceClickDirective implements OnInit, OnDestroy { @Output() readonly debouncedClick = new EventEmitter(); private readonly clicks = new Subject(); private subscription: Subscription; - private isBrowser = false; - - constructor(@Inject(PLATFORM_ID) platformId: string) { - this.isBrowser = isPlatformBrowser(platformId); - } ngOnInit() { this.listenToClicks(); diff --git a/projects/ngx-eq/src/ngx-eq.directive.spec.ts b/projects/ngx-eq/src/ngx-eq.directive.spec.ts index f6bff1e..acf83b0 100644 --- a/projects/ngx-eq/src/ngx-eq.directive.spec.ts +++ b/projects/ngx-eq/src/ngx-eq.directive.spec.ts @@ -17,7 +17,6 @@ import { NgxEqModule } from './ngx-eq.module'; class TestComponent {} describe('NgxEqDirective', () => { - let component: TestComponent; let fixture: ComponentFixture; beforeEach(async(() => { @@ -27,10 +26,9 @@ describe('NgxEqDirective', () => { }).compileComponents(); fixture = TestBed.createComponent(TestComponent); - component = fixture.componentInstance; })); - it('should apply ngx-eq css class', fakeAsync(done => { + it('should apply ngx-eq css class', fakeAsync(() => { tick(); expect(fixture.nativeElement.innerHTML).toContain('ngx-eq'); })); diff --git a/projects/ngx-input-star-rating/src/ngx-input-star-rating.component.spec.ts b/projects/ngx-input-star-rating/src/ngx-input-star-rating.component.spec.ts index 4a6865d..c710b7f 100644 --- a/projects/ngx-input-star-rating/src/ngx-input-star-rating.component.spec.ts +++ b/projects/ngx-input-star-rating/src/ngx-input-star-rating.component.spec.ts @@ -21,7 +21,6 @@ class TestComponent { describe('NgxInputStarRatingComponent', () => { let component: TestComponent; let fixture: ComponentFixture; - let switchEl; beforeEach(async(() => { TestBed.configureTestingModule({ @@ -34,7 +33,6 @@ describe('NgxInputStarRatingComponent', () => { fixture = TestBed.createComponent(TestComponent); component = fixture.componentInstance; fixture.detectChanges(); - switchEl = fixture.nativeElement.querySelector('.input-rating'); }); it('should create', () => { diff --git a/projects/ngx-input-switch/src/ngx-input-switch.component.spec.ts b/projects/ngx-input-switch/src/ngx-input-switch.component.spec.ts index c779c6c..3d11a3a 100644 --- a/projects/ngx-input-switch/src/ngx-input-switch.component.spec.ts +++ b/projects/ngx-input-switch/src/ngx-input-switch.component.spec.ts @@ -21,7 +21,6 @@ class TestComponent { describe('NgxInputSwitchComponent', () => { let component: TestComponent; let fixture: ComponentFixture; - let switchEl; beforeEach(async(() => { TestBed.configureTestingModule({ @@ -34,7 +33,6 @@ describe('NgxInputSwitchComponent', () => { fixture = TestBed.createComponent(TestComponent); component = fixture.componentInstance; fixture.detectChanges(); - switchEl = fixture.nativeElement.querySelector('.switch'); }); it('should create', () => { diff --git a/projects/ngx-json-ld/src/ngx-json-ld.component.spec.ts b/projects/ngx-json-ld/src/ngx-json-ld.component.spec.ts index 544011f..d2f6495 100644 --- a/projects/ngx-json-ld/src/ngx-json-ld.component.spec.ts +++ b/projects/ngx-json-ld/src/ngx-json-ld.component.spec.ts @@ -1,7 +1,6 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NgxJsonLdComponent } from './ngx-json-ld.component'; -import { SimpleChange } from '@angular/core'; const testSchema = { '@context': 'http://schema.org', diff --git a/projects/ngx-nav-drawer/src/ngx-nav-drawer.component.ts b/projects/ngx-nav-drawer/src/ngx-nav-drawer.component.ts index e58e7be..f980875 100644 --- a/projects/ngx-nav-drawer/src/ngx-nav-drawer.component.ts +++ b/projects/ngx-nav-drawer/src/ngx-nav-drawer.component.ts @@ -52,7 +52,7 @@ export class NgxNavDrawerComponent implements OnChanges, OnDestroy, OnInit { ngOnInit() { if (isPlatformBrowser(this.platformId)) { this.setFixedPosition(); - this.subscription = fromEvent(window, 'resize').subscribe(event => + this.subscription = fromEvent(window, 'resize').subscribe(() => this.setFixedPosition() ); } diff --git a/projects/ngx-tabs/src/ngx-tabs.component.ts b/projects/ngx-tabs/src/ngx-tabs.component.ts index cda869c..8b472dc 100644 --- a/projects/ngx-tabs/src/ngx-tabs.component.ts +++ b/projects/ngx-tabs/src/ngx-tabs.component.ts @@ -10,7 +10,6 @@ import { ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core'; -import { tap } from 'rxjs/operators'; @Component({ selector: 'ngx-tabs', diff --git a/tsconfig.json b/tsconfig.json index b9316d9..46c2147 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,8 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, + "noUnusedLocals": true, + "noUnusedParameters": true, "target": "es2015", "typeRoots": [ "node_modules/@types"