From d5842149f4b94dddc292f3b45efd1973364cfda6 Mon Sep 17 00:00:00 2001 From: Ronan Connolly Date: Tue, 7 May 2024 17:11:30 +0200 Subject: [PATCH] Update linting --- .eslintrc.json | 4 +++- src/app/app.config.ts | 10 +--------- .../data/rest/the-movie-db/the-movie-db.service.ts | 2 +- src/app/views/search/search.component.spec.ts | 2 +- src/app/views/search/search.component.ts | 5 ++--- src/main.ts | 1 + 6 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index bef4689..6a13335 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -35,7 +35,9 @@ "prefix": "mose", "style": "kebab-case" } - ] + ], + "no-unused-vars": "warn", + "no-console": "error" } }, { diff --git a/src/app/app.config.ts b/src/app/app.config.ts index 4af8497..09601df 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -1,8 +1,7 @@ -import { APP_INITIALIZER, ApplicationConfig } from '@angular/core'; +import { ApplicationConfig } from '@angular/core'; import { provideRouter, withHashLocation } from '@angular/router'; import { appRoutes } from './app.routes'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; -import { MovieStoreService } from './shared/data/store/movie-store/movie-store.service'; import { provideHttpClient } from '@angular/common/http'; export const appConfig: ApplicationConfig = { @@ -10,12 +9,5 @@ export const appConfig: ApplicationConfig = { provideRouter(appRoutes, withHashLocation()), provideAnimationsAsync(), provideHttpClient(), - // { - // provide: APP_INITIALIZER, - // useFactory: (movieStoreService: MovieStoreService) => { - // movieStoreService.initStore(); - // }, - // deps: [MovieStoreService], - // }, ], }; diff --git a/src/app/shared/data/rest/the-movie-db/the-movie-db.service.ts b/src/app/shared/data/rest/the-movie-db/the-movie-db.service.ts index 1155e4a..29582b7 100644 --- a/src/app/shared/data/rest/the-movie-db/the-movie-db.service.ts +++ b/src/app/shared/data/rest/the-movie-db/the-movie-db.service.ts @@ -1,6 +1,6 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Observable, tap } from 'rxjs'; +import { Observable } from 'rxjs'; import { apiKeyQueryParam, tmdbApiFindById, diff --git a/src/app/views/search/search.component.spec.ts b/src/app/views/search/search.component.spec.ts index e0e25c0..96087b2 100644 --- a/src/app/views/search/search.component.spec.ts +++ b/src/app/views/search/search.component.spec.ts @@ -6,7 +6,7 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; -import { HttpClientModule, provideHttpClient } from '@angular/common/http'; +import { HttpClientModule } from '@angular/common/http'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; describe('SearchComponent', () => { diff --git a/src/app/views/search/search.component.ts b/src/app/views/search/search.component.ts index 41a87ea..267ee63 100644 --- a/src/app/views/search/search.component.ts +++ b/src/app/views/search/search.component.ts @@ -6,7 +6,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; -import { debounce, debounceTime } from 'rxjs'; +import { debounceTime } from 'rxjs'; import { Router } from '@angular/router'; @Component({ @@ -33,7 +33,7 @@ export class SearchComponent { public constructor( public movieStoreService: MovieStoreService, - public router: Router + private router: Router ) { this.searchFormControl.valueChanges .pipe(debounceTime(500)) @@ -53,7 +53,6 @@ export class SearchComponent { } public goToMovieDetail(movieId: number): void { - console.log({ movieId }); this.router.navigate([`/movie-detail`, { movieId }]); } } diff --git a/src/main.ts b/src/main.ts index 514c89a..dc91774 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,5 +3,6 @@ import { appConfig } from './app/app.config'; import { AppComponent } from './app/app.component'; bootstrapApplication(AppComponent, appConfig).catch((err) => + //eslint-disable-next-line no-console console.error(err) );