From 03f3975132982256326c7ba2388b0d44ece5b27e Mon Sep 17 00:00:00 2001 From: Nato Boram Date: Tue, 7 Jul 2020 20:20:02 -0400 Subject: [PATCH] ng lint --- angular.json | 5 +++-- e2e/src/app.e2e-spec.ts | 8 ++++---- src/app/app.component.spec.ts | 12 ++++++------ src/app/pages/pages.component.spec.ts | 8 ++++---- src/app/pages/pages.component.ts | 8 ++++---- src/app/services/gateway.service.spec.ts | 11 +++++------ src/main.ts | 2 +- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/angular.json b/angular.json index b535add..ee65ecf 100644 --- a/angular.json +++ b/angular.json @@ -196,6 +196,7 @@ }, "defaultProject": "public-gateway-cacher", "cli": { - "packageManager": "yarn" + "packageManager": "yarn", + "analytics": "10b848ad-8b81-4346-852f-5eff89573a85" } -} +} \ No newline at end of file diff --git a/e2e/src/app.e2e-spec.ts b/e2e/src/app.e2e-spec.ts index 0db09bf..954281e 100644 --- a/e2e/src/app.e2e-spec.ts +++ b/e2e/src/app.e2e-spec.ts @@ -1,19 +1,19 @@ import { browser, logging } from 'protractor'; import { AppPage } from './app.po'; -describe('workspace-project App', () => { +describe('workspace-project App', (): void => { let page: AppPage; - beforeEach(() => { + beforeEach((): void => { page = new AppPage(); }); - it('should display welcome message', () => { + it('should display welcome message', (): void => { page.navigateTo(); expect(page.getTitleText()).toEqual('public-gateway-cacher app is running!'); }); - afterEach(async () => { + afterEach(async (): Promise => { // Assert that there are no errors emitted from the browser const logs = await browser.manage().logs().get(logging.Type.BROWSER); expect(logs).not.toContain(jasmine.objectContaining({ diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index b56922a..e218fd3 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,9 +1,9 @@ -import { TestBed, async } from '@angular/core/testing'; +import { async, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { AppComponent } from './app.component'; -describe('AppComponent', () => { - beforeEach(async(() => { +describe('AppComponent', (): void => { + beforeEach(async((): void => { TestBed.configureTestingModule({ imports: [ RouterTestingModule @@ -14,19 +14,19 @@ describe('AppComponent', () => { }).compileComponents(); })); - it('should create the app', () => { + it('should create the app', (): void => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); }); - it(`should have as title 'public-gateway-cacher'`, () => { + it(`should have as title 'public-gateway-cacher'`, (): void => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app.title).toEqual('public-gateway-cacher'); }); - it('should render title', () => { + it('should render title', (): void => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.debugElement.nativeElement; diff --git a/src/app/pages/pages.component.spec.ts b/src/app/pages/pages.component.spec.ts index 56a2c23..226b368 100644 --- a/src/app/pages/pages.component.spec.ts +++ b/src/app/pages/pages.component.spec.ts @@ -1,24 +1,24 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { PagesComponent } from './pages.component'; -describe('PagesComponent', () => { +describe('PagesComponent', (): void => { let component: PagesComponent; let fixture: ComponentFixture; - beforeEach(async(() => { + beforeEach(async((): void => { TestBed.configureTestingModule({ declarations: [PagesComponent] }) .compileComponents(); })); - beforeEach(() => { + beforeEach((): void => { fixture = TestBed.createComponent(PagesComponent); component = fixture.componentInstance; fixture.detectChanges(); }); - it('should create', () => { + it('should create', (): void => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/pages.component.ts b/src/app/pages/pages.component.ts index 026219a..847fdc3 100644 --- a/src/app/pages/pages.component.ts +++ b/src/app/pages/pages.component.ts @@ -29,7 +29,7 @@ export class PagesComponent implements OnInit { ngOnInit(): void { this.dataSource = new MatTableDataSource([]); - this.gatewayService.list().subscribe(gateways => this.gateways = gateways); + this.gatewayService.list().subscribe((gateways): void => { this.gateways = gateways; }); } cacheIPFS(): void { @@ -53,12 +53,12 @@ export class PagesComponent implements OnInit { this.matTable.renderRows(); console.clear(); - this.gateways.forEach(gateway => { + this.gateways.forEach((gateway): void => { this.subscriptions.push( - this.gatewayService.get(gateway, type, hash).subscribe(_ => { + this.gatewayService.get(gateway, type, hash).subscribe((): void => { this.dataSource.data.push({ gateway: `${gateway.replace(':type', type).replace(':hash', hash)}`, error: null }); this.matTable.renderRows(); - }, (error: HttpErrorResponse) => { + }, (error: HttpErrorResponse): void => { this.dataSource.data.push({ gateway: `${gateway.replace(':type', type).replace(':hash', hash)}`, error }); this.matTable.renderRows(); }) diff --git a/src/app/services/gateway.service.spec.ts b/src/app/services/gateway.service.spec.ts index ce041cd..0e99d0e 100644 --- a/src/app/services/gateway.service.spec.ts +++ b/src/app/services/gateway.service.spec.ts @@ -1,12 +1,11 @@ -import { TestBed } from '@angular/core/testing'; - +import { TestBed, TestBedStatic } from '@angular/core/testing'; import { GatewayService } from './gateway.service'; -describe('GatewayService', () => { - beforeEach(() => TestBed.configureTestingModule({})); +describe('GatewayService', (): void => { + beforeEach((): TestBedStatic => TestBed.configureTestingModule({})); - it('should be created', () => { - const service: GatewayService = TestBed.get(GatewayService); + it('should be created', (): void => { + const service: GatewayService = TestBed.inject(GatewayService); expect(service).toBeTruthy(); }); }); diff --git a/src/main.ts b/src/main.ts index 928591b..50b0ec7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,4 +8,4 @@ if (environment.production) { } platformBrowserDynamic().bootstrapModule(AppModule) - .catch(err => console.error(err)); + .catch((err): void => console.error(err));