From 2317fa54e490b9039c297a41bf66a347e332431a Mon Sep 17 00:00:00 2001 From: Uday Vunnam <20707504+udayvunnam@users.noreply.github.com> Date: Fri, 16 Oct 2020 10:40:15 +0530 Subject: [PATCH] fix: lint and material theme (#53) --- angular.json | 5 +++- .../src/integration/default.spec.ts | 4 +-- .../src/support/commands.ts | 2 +- apps/breadcrumb-demo/src/app/app.component.ts | 6 ++--- .../connect-success.component.ts | 8 ++---- .../app/connect/connect/connect.component.ts | 8 ++---- .../src/app/core/in-memory-data.service.ts | 7 ++--- .../src/app/core/navbar/navbar.component.ts | 8 ++---- .../dashboard/dashboard.component.ts | 8 ++---- .../src/app/home/home.component.ts | 8 ++---- .../mentee/mentee-add/mentee-add.component.ts | 4 +-- .../mentee-details.component.ts | 2 +- .../mentee-edit/mentee-edit.component.ts | 4 +-- .../src/app/mentee/mentee/mentee.component.ts | 8 ++---- .../mentor/mentor-add/mentor-add.component.ts | 4 +-- .../mentor-details.component.ts | 2 +- .../mentor-edit/mentor-edit.component.ts | 4 +-- .../src/app/mentor/mentor/mentor.component.ts | 8 ++---- .../src/assets/scss/material-theme.scss | 26 +++++++++++++++++++ .../src/assets/scss/xng-breadcrumb.scss | 26 ------------------- apps/breadcrumb-demo/src/styles.scss | 2 -- .../designer-dashboard.component.ts | 8 ++---- .../view-library/view-library.component.ts | 8 ++---- .../components/footer/footer.component.ts | 8 ++---- .../components/header/header.component.ts | 8 ++---- .../components/menubar/menubar.component.ts | 8 ++---- apps/got-demo-e2e/src/support/commands.ts | 2 +- apps/got-demo/src/app/book/book.component.ts | 2 +- .../got-demo/src/app/books/books.component.ts | 2 +- .../src/app/character/character.component.ts | 8 ++---- apps/got-demo/src/app/data.service.ts | 22 +++++++--------- .../src/app/houses/houses.component.ts | 2 +- .../src/lib/types/breadcrumb.config.ts | 2 +- .../src/lib/types/breadcrumb.ts | 2 +- 34 files changed, 89 insertions(+), 147 deletions(-) create mode 100644 apps/breadcrumb-demo/src/assets/scss/material-theme.scss delete mode 100644 apps/breadcrumb-demo/src/assets/scss/xng-breadcrumb.scss diff --git a/angular.json b/angular.json index e137ab6..37cac63 100644 --- a/angular.json +++ b/angular.json @@ -25,7 +25,10 @@ "apps/breadcrumb-demo/src/favicon.ico", "apps/breadcrumb-demo/src/assets" ], - "styles": ["apps/breadcrumb-demo/src/styles.scss"], + "styles": [ + "apps/breadcrumb-demo/src/assets/scss/material-theme.scss", + "apps/breadcrumb-demo/src/styles.scss" + ], "scripts": [] }, "configurations": { diff --git a/apps/breadcrumb-demo-e2e/src/integration/default.spec.ts b/apps/breadcrumb-demo-e2e/src/integration/default.spec.ts index 0efe789..c60a66e 100644 --- a/apps/breadcrumb-demo-e2e/src/integration/default.spec.ts +++ b/apps/breadcrumb-demo-e2e/src/integration/default.spec.ts @@ -1,9 +1,8 @@ import { getDefaultBreadcrumbs } from '../support/app.po'; -import { resolve } from 'cypress/types/bluebird'; +//import { resolve } from 'cypress/types/bluebird'; describe('breadcrumb-demo', () => { // beforeEach(() => cy.visit('/')); - let mentorDetailsPath = ''; it('should display default breadcrumbs for home', () => { cy.visit('/'); getDefaultBreadcrumbs().contains('my home'); @@ -23,7 +22,6 @@ describe('breadcrumb-demo', () => { it('should have valid path and breadcrumbs for Mentor Details', () => { cy.get('bd-mentor-list .mat-card-avatar').eq(0).click(); cy.location().should((loc) => { - mentorDetailsPath = loc.pathname; expect(loc.search).to.eq('?type=details'); }); getDefaultBreadcrumbs().contains('my home'); diff --git a/apps/breadcrumb-demo-e2e/src/support/commands.ts b/apps/breadcrumb-demo-e2e/src/support/commands.ts index 61b3a3e..c301a6f 100644 --- a/apps/breadcrumb-demo-e2e/src/support/commands.ts +++ b/apps/breadcrumb-demo-e2e/src/support/commands.ts @@ -9,7 +9,7 @@ // *********************************************** // eslint-disable-next-line @typescript-eslint/no-namespace declare namespace Cypress { - interface Chainable { + interface Chainable { login(email: string, password: string): void; } } diff --git a/apps/breadcrumb-demo/src/app/app.component.ts b/apps/breadcrumb-demo/src/app/app.component.ts index b32d093..455ac18 100644 --- a/apps/breadcrumb-demo/src/app/app.component.ts +++ b/apps/breadcrumb-demo/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; import { Router } from '@angular/router'; @Component({ @@ -6,14 +6,12 @@ import { Router } from '@angular/router'; templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], }) -export class AppComponent implements OnInit { +export class AppComponent { title = 'xng-breadcrumb-app'; darkMode = false; constructor(private router: Router) {} - ngOnInit() {} - updateTheme(theme) { this.darkMode = theme === 'dark'; } diff --git a/apps/breadcrumb-demo/src/app/connect/connect-success/connect-success.component.ts b/apps/breadcrumb-demo/src/app/connect/connect-success/connect-success.component.ts index a12560b..be287a0 100644 --- a/apps/breadcrumb-demo/src/app/connect/connect-success/connect-success.component.ts +++ b/apps/breadcrumb-demo/src/app/connect/connect-success/connect-success.component.ts @@ -1,12 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'bd-connect-success', templateUrl: './connect-success.component.html', styleUrls: ['./connect-success.component.scss'], }) -export class ConnectSuccessComponent implements OnInit { - constructor() {} - - ngOnInit() {} -} +export class ConnectSuccessComponent {} diff --git a/apps/breadcrumb-demo/src/app/connect/connect/connect.component.ts b/apps/breadcrumb-demo/src/app/connect/connect/connect.component.ts index 3b0ceea..7be51e9 100644 --- a/apps/breadcrumb-demo/src/app/connect/connect/connect.component.ts +++ b/apps/breadcrumb-demo/src/app/connect/connect/connect.component.ts @@ -1,12 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'bd-connect', templateUrl: './connect.component.html', styleUrls: ['./connect.component.scss'], }) -export class ConnectComponent implements OnInit { - constructor() {} - - ngOnInit() {} -} +export class ConnectComponent {} diff --git a/apps/breadcrumb-demo/src/app/core/in-memory-data.service.ts b/apps/breadcrumb-demo/src/app/core/in-memory-data.service.ts index 4faa312..d9b6d70 100644 --- a/apps/breadcrumb-demo/src/app/core/in-memory-data.service.ts +++ b/apps/breadcrumb-demo/src/app/core/in-memory-data.service.ts @@ -24,7 +24,10 @@ export const allLanguages = [ 'HTML', ]; -const getRandomArray = (sourceArray: Array, targetArrayLength: number) => { +const getRandomArray = ( + sourceArray: Array, + targetArrayLength: number +) => { return sourceArray .sort(() => 0.5 - Math.random()) .slice(0, targetArrayLength); @@ -56,8 +59,6 @@ const persons = (count = 10) => { providedIn: 'root', }) export class InMemoryDataService implements InMemoryDbService { - constructor() {} - createDb() { const mentors = persons(10); const mentees = persons(10); diff --git a/apps/breadcrumb-demo/src/app/core/navbar/navbar.component.ts b/apps/breadcrumb-demo/src/app/core/navbar/navbar.component.ts index 5241f5f..24a03ca 100644 --- a/apps/breadcrumb-demo/src/app/core/navbar/navbar.component.ts +++ b/apps/breadcrumb-demo/src/app/core/navbar/navbar.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Output } from '@angular/core'; +import { Component, Output } from '@angular/core'; import { EventEmitter } from '@angular/core'; @Component({ @@ -6,14 +6,10 @@ import { EventEmitter } from '@angular/core'; templateUrl: './navbar.component.html', styleUrls: ['./navbar.component.scss'], }) -export class NavbarComponent implements OnInit { +export class NavbarComponent { theme = 'light'; @Output() themeChanged: EventEmitter = new EventEmitter(); - constructor() {} - - ngOnInit() {} - toggleTheme() { this.theme = this.theme === 'light' ? 'dark' : 'light'; this.themeChanged.emit(this.theme); diff --git a/apps/breadcrumb-demo/src/app/dashboard/dashboard/dashboard.component.ts b/apps/breadcrumb-demo/src/app/dashboard/dashboard/dashboard.component.ts index 6441974..e7e1139 100644 --- a/apps/breadcrumb-demo/src/app/dashboard/dashboard/dashboard.component.ts +++ b/apps/breadcrumb-demo/src/app/dashboard/dashboard/dashboard.component.ts @@ -1,11 +1,7 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'bd-dashboard', templateUrl: './dashboard.component.html', styleUrls: ['./dashboard.component.scss'], }) -export class DashboardComponent implements OnInit { - constructor() {} - - ngOnInit() {} -} +export class DashboardComponent {} diff --git a/apps/breadcrumb-demo/src/app/home/home.component.ts b/apps/breadcrumb-demo/src/app/home/home.component.ts index 5a74f4a..c201b84 100644 --- a/apps/breadcrumb-demo/src/app/home/home.component.ts +++ b/apps/breadcrumb-demo/src/app/home/home.component.ts @@ -1,12 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'bd-home', templateUrl: './home.component.html', styleUrls: ['./home.component.scss'], }) -export class HomeComponent implements OnInit { - constructor() {} - - ngOnInit() {} -} +export class HomeComponent {} diff --git a/apps/breadcrumb-demo/src/app/mentee/mentee-add/mentee-add.component.ts b/apps/breadcrumb-demo/src/app/mentee/mentee-add/mentee-add.component.ts index 8ba2a5a..20a9dab 100644 --- a/apps/breadcrumb-demo/src/app/mentee/mentee-add/mentee-add.component.ts +++ b/apps/breadcrumb-demo/src/app/mentee/mentee-add/mentee-add.component.ts @@ -21,7 +21,7 @@ import { allLanguages } from '../../core/in-memory-data.service'; styleUrls: ['./mentee-add.component.scss'], }) export class MenteeAddComponent implements OnInit { - mentee: any; + mentee: unknown; menteeFG: FormGroup; separatorKeysCodes: number[] = [ENTER, COMMA]; @@ -71,7 +71,7 @@ export class MenteeAddComponent implements OnInit { mentee.available = this.menteeFG.value.available; mentee.skills = this.skills; - this.dataService.addMentee(mentee).subscribe((response: any) => { + this.dataService.addMentee(mentee).subscribe(() => { const navigationExtras: NavigationExtras = { queryParams: { addedMentor: mentee.id }, }; diff --git a/apps/breadcrumb-demo/src/app/mentee/mentee-details/mentee-details.component.ts b/apps/breadcrumb-demo/src/app/mentee/mentee-details/mentee-details.component.ts index 63a46e0..a02c133 100644 --- a/apps/breadcrumb-demo/src/app/mentee/mentee-details/mentee-details.component.ts +++ b/apps/breadcrumb-demo/src/app/mentee/mentee-details/mentee-details.component.ts @@ -10,7 +10,7 @@ import { DataService } from '../../core/data.service'; styleUrls: ['./mentee-details.component.scss'], }) export class MenteeDetailsComponent implements OnInit { - mentee: any; + mentee: unknown; constructor( private breadcrumbService: BreadcrumbService, private dataService: DataService, diff --git a/apps/breadcrumb-demo/src/app/mentee/mentee-edit/mentee-edit.component.ts b/apps/breadcrumb-demo/src/app/mentee/mentee-edit/mentee-edit.component.ts index 756814d..d1d4231 100644 --- a/apps/breadcrumb-demo/src/app/mentee/mentee-edit/mentee-edit.component.ts +++ b/apps/breadcrumb-demo/src/app/mentee/mentee-edit/mentee-edit.component.ts @@ -21,7 +21,7 @@ import { Mentee } from '../../shared/models/mentee'; styleUrls: ['./mentee-edit.component.scss'], }) export class MenteeEditComponent implements OnInit { - menteeId: any; + menteeId: string; menteeFG: FormGroup; separatorKeysCodes: number[] = [ENTER, COMMA]; @@ -89,7 +89,7 @@ export class MenteeEditComponent implements OnInit { queryParams: { editedMentee: this.menteeId }, }; - this.dataService.updateMentee(mentee).subscribe((response: any) => { + this.dataService.updateMentee(mentee).subscribe(() => { this.snackBar.open(`Mentee updated - ${mentee.name}`, 'Ok'); this.router.navigate(['mentee', this.menteeId], navigationExtras); }); diff --git a/apps/breadcrumb-demo/src/app/mentee/mentee/mentee.component.ts b/apps/breadcrumb-demo/src/app/mentee/mentee/mentee.component.ts index ebc04ff..178bcda 100644 --- a/apps/breadcrumb-demo/src/app/mentee/mentee/mentee.component.ts +++ b/apps/breadcrumb-demo/src/app/mentee/mentee/mentee.component.ts @@ -1,12 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'bd-mentee', templateUrl: './mentee.component.html', styleUrls: ['./mentee.component.scss'], }) -export class MenteeComponent implements OnInit { - constructor() {} - - ngOnInit() {} -} +export class MenteeComponent {} diff --git a/apps/breadcrumb-demo/src/app/mentor/mentor-add/mentor-add.component.ts b/apps/breadcrumb-demo/src/app/mentor/mentor-add/mentor-add.component.ts index 40f9360..04b4cbc 100644 --- a/apps/breadcrumb-demo/src/app/mentor/mentor-add/mentor-add.component.ts +++ b/apps/breadcrumb-demo/src/app/mentor/mentor-add/mentor-add.component.ts @@ -22,7 +22,7 @@ import { BreadcrumbService } from '@xng/xng-breadcrumb'; styleUrls: ['./mentor-add.component.scss'], }) export class MentorAddComponent implements OnInit { - mentor: any; + mentor: unknown; mentorFG: FormGroup; separatorKeysCodes: number[] = [ENTER, COMMA]; @@ -74,7 +74,7 @@ export class MentorAddComponent implements OnInit { mentor.available = this.mentorFG.value.available; mentor.skills = this.skills; - this.dataService.addMentor(mentor).subscribe((response: any) => { + this.dataService.addMentor(mentor).subscribe(() => { const navigationExtras: NavigationExtras = { queryParams: { addedMentor: mentor.id }, }; diff --git a/apps/breadcrumb-demo/src/app/mentor/mentor-details/mentor-details.component.ts b/apps/breadcrumb-demo/src/app/mentor/mentor-details/mentor-details.component.ts index e67207b..6f286e5 100644 --- a/apps/breadcrumb-demo/src/app/mentor/mentor-details/mentor-details.component.ts +++ b/apps/breadcrumb-demo/src/app/mentor/mentor-details/mentor-details.component.ts @@ -10,7 +10,7 @@ import { DataService } from '../../core/data.service'; styleUrls: ['./mentor-details.component.scss'], }) export class MentorDetailsComponent implements OnInit { - mentor: any; + mentor: { name: string }; constructor( private breadcrumbService: BreadcrumbService, private dataService: DataService, diff --git a/apps/breadcrumb-demo/src/app/mentor/mentor-edit/mentor-edit.component.ts b/apps/breadcrumb-demo/src/app/mentor/mentor-edit/mentor-edit.component.ts index 8addc1a..58ddbe2 100644 --- a/apps/breadcrumb-demo/src/app/mentor/mentor-edit/mentor-edit.component.ts +++ b/apps/breadcrumb-demo/src/app/mentor/mentor-edit/mentor-edit.component.ts @@ -21,7 +21,7 @@ import { BreadcrumbService } from '@xng/xng-breadcrumb'; styleUrls: ['./mentor-edit.component.scss'], }) export class MentorEditComponent implements OnInit { - mentorId: any; + mentorId: string; mentorFG: FormGroup; separatorKeysCodes: number[] = [ENTER, COMMA]; @@ -89,7 +89,7 @@ export class MentorEditComponent implements OnInit { queryParams: { editedMentee: this.mentorId }, }; - this.dataService.updateMentor(mentor).subscribe((response: any) => { + this.dataService.updateMentor(mentor).subscribe(() => { this.snackBar.open(`Mentor updated - ${mentor.name}`, 'Ok'); this.router.navigate(['mentor', this.mentorId], navigationExtras); }); diff --git a/apps/breadcrumb-demo/src/app/mentor/mentor/mentor.component.ts b/apps/breadcrumb-demo/src/app/mentor/mentor/mentor.component.ts index c077e7d..61a8287 100644 --- a/apps/breadcrumb-demo/src/app/mentor/mentor/mentor.component.ts +++ b/apps/breadcrumb-demo/src/app/mentor/mentor/mentor.component.ts @@ -1,12 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'bd-mentor', templateUrl: './mentor.component.html', styleUrls: ['./mentor.component.scss'], }) -export class MentorComponent implements OnInit { - constructor() {} - - ngOnInit() {} -} +export class MentorComponent {} diff --git a/apps/breadcrumb-demo/src/assets/scss/material-theme.scss b/apps/breadcrumb-demo/src/assets/scss/material-theme.scss new file mode 100644 index 0000000..3e53fb7 --- /dev/null +++ b/apps/breadcrumb-demo/src/assets/scss/material-theme.scss @@ -0,0 +1,26 @@ +@import '~@angular/material/theming'; +// Plus imports for other components in your app. + +// Include the common styles for Angular Material. We include this here so that you only +// have to load a single css file for Angular Material in your app. +@include mat-core(); + +$xng-app-primary: mat-palette($mat-teal); +$xng-app-accent: mat-palette($mat-green, A200, A100, A400); +$xng-app-warn: mat-palette($mat-red); +$xng-light-theme: mat-light-theme( + $xng-app-primary, + $xng-app-accent, + $xng-app-warn +); +$xng-dark-theme: mat-dark-theme( + $xng-app-primary, + $xng-app-accent, + $xng-app-warn +); + +@include angular-material-theme($xng-light-theme); + +.xng-dark-theme { + @include angular-material-theme($xng-dark-theme); +} diff --git a/apps/breadcrumb-demo/src/assets/scss/xng-breadcrumb.scss b/apps/breadcrumb-demo/src/assets/scss/xng-breadcrumb.scss deleted file mode 100644 index 3d4e745..0000000 --- a/apps/breadcrumb-demo/src/assets/scss/xng-breadcrumb.scss +++ /dev/null @@ -1,26 +0,0 @@ -// @import '~@angular/material/theming'; -// // Plus imports for other components in your app. - -// // Include the common styles for Angular Material. We include this here so that you only -// // have to load a single css file for Angular Material in your app. -// @include mat-core(); - -// $xng-app-primary: mat-palette($mat-teal); -// $xng-app-accent: mat-palette($mat-green, A200, A100, A400); -// $xng-app-warn: mat-palette($mat-red); -// $xng-light-theme: mat-light-theme( -// $xng-app-primary, -// $xng-app-accent, -// $xng-app-warn -// ); -// $xng-dark-theme: mat-dark-theme( -// $xng-app-primary, -// $xng-app-accent, -// $xng-app-warn -// ); - -// @include angular-material-theme($xng-light-theme); - -// .xng-dark-theme { -// @include angular-material-theme($xng-dark-theme); -// } diff --git a/apps/breadcrumb-demo/src/styles.scss b/apps/breadcrumb-demo/src/styles.scss index 06ef0da..e33c902 100644 --- a/apps/breadcrumb-demo/src/styles.scss +++ b/apps/breadcrumb-demo/src/styles.scss @@ -1,5 +1,3 @@ -@import '@angular/material/prebuilt-themes/deeppurple-amber.css'; - html, body { height: 100%; diff --git a/apps/demo/src/app/Modules/features/designer/components/designer-dashboard/designer-dashboard.component.ts b/apps/demo/src/app/Modules/features/designer/components/designer-dashboard/designer-dashboard.component.ts index 0e7c0c1..a0156a3 100644 --- a/apps/demo/src/app/Modules/features/designer/components/designer-dashboard/designer-dashboard.component.ts +++ b/apps/demo/src/app/Modules/features/designer/components/designer-dashboard/designer-dashboard.component.ts @@ -1,12 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'app-designer-dashboard', templateUrl: './designer-dashboard.component.html', styleUrls: ['./designer-dashboard.component.scss'], }) -export class DesignerDashboardComponent implements OnInit { - constructor() {} - - ngOnInit(): void {} -} +export class DesignerDashboardComponent {} diff --git a/apps/demo/src/app/Modules/features/library/components/view-library/view-library.component.ts b/apps/demo/src/app/Modules/features/library/components/view-library/view-library.component.ts index e49cf6f..388e11e 100644 --- a/apps/demo/src/app/Modules/features/library/components/view-library/view-library.component.ts +++ b/apps/demo/src/app/Modules/features/library/components/view-library/view-library.component.ts @@ -1,12 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'app-view-library', templateUrl: './view-library.component.html', styleUrls: ['./view-library.component.scss'], }) -export class ViewLibraryComponent implements OnInit { - constructor() {} - - ngOnInit(): void {} -} +export class ViewLibraryComponent {} diff --git a/apps/demo/src/app/Modules/layout/components/footer/footer.component.ts b/apps/demo/src/app/Modules/layout/components/footer/footer.component.ts index 4d94a8a..8ea7023 100644 --- a/apps/demo/src/app/Modules/layout/components/footer/footer.component.ts +++ b/apps/demo/src/app/Modules/layout/components/footer/footer.component.ts @@ -1,12 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'app-footer', templateUrl: './footer.component.html', styleUrls: ['./footer.component.scss'], }) -export class FooterComponent implements OnInit { - constructor() {} - - ngOnInit(): void {} -} +export class FooterComponent {} diff --git a/apps/demo/src/app/Modules/layout/components/header/header.component.ts b/apps/demo/src/app/Modules/layout/components/header/header.component.ts index 84aef6d..7082d31 100644 --- a/apps/demo/src/app/Modules/layout/components/header/header.component.ts +++ b/apps/demo/src/app/Modules/layout/components/header/header.component.ts @@ -1,12 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'app-header', templateUrl: './header.component.html', styleUrls: ['./header.component.scss'], }) -export class HeaderComponent implements OnInit { - constructor() {} - - ngOnInit(): void {} -} +export class HeaderComponent {} diff --git a/apps/demo/src/app/Modules/layout/components/menubar/menubar.component.ts b/apps/demo/src/app/Modules/layout/components/menubar/menubar.component.ts index 8ab428a..fe3d3bb 100644 --- a/apps/demo/src/app/Modules/layout/components/menubar/menubar.component.ts +++ b/apps/demo/src/app/Modules/layout/components/menubar/menubar.component.ts @@ -1,12 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'app-menubar', templateUrl: './menubar.component.html', styleUrls: ['./menubar.component.scss'], }) -export class MenubarComponent implements OnInit { - constructor() {} - - ngOnInit(): void {} -} +export class MenubarComponent {} diff --git a/apps/got-demo-e2e/src/support/commands.ts b/apps/got-demo-e2e/src/support/commands.ts index 61b3a3e..c301a6f 100644 --- a/apps/got-demo-e2e/src/support/commands.ts +++ b/apps/got-demo-e2e/src/support/commands.ts @@ -9,7 +9,7 @@ // *********************************************** // eslint-disable-next-line @typescript-eslint/no-namespace declare namespace Cypress { - interface Chainable { + interface Chainable { login(email: string, password: string): void; } } diff --git a/apps/got-demo/src/app/book/book.component.ts b/apps/got-demo/src/app/book/book.component.ts index 5bbd2c8..b217b72 100644 --- a/apps/got-demo/src/app/book/book.component.ts +++ b/apps/got-demo/src/app/book/book.component.ts @@ -9,7 +9,7 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./book.component.css'], }) export class BookComponent implements OnInit { - book$: Observable; + book$: Observable; constructor( private dataService: DataService, private route: ActivatedRoute diff --git a/apps/got-demo/src/app/books/books.component.ts b/apps/got-demo/src/app/books/books.component.ts index 8ce2cb6..4a47eee 100644 --- a/apps/got-demo/src/app/books/books.component.ts +++ b/apps/got-demo/src/app/books/books.component.ts @@ -8,7 +8,7 @@ import { Observable } from 'rxjs'; styleUrls: ['./books.component.css'], }) export class BooksComponent implements OnInit { - books$: Observable; + books$: Observable; constructor(private dataService: DataService) {} ngOnInit(): void { diff --git a/apps/got-demo/src/app/character/character.component.ts b/apps/got-demo/src/app/character/character.component.ts index 607796f..487e594 100644 --- a/apps/got-demo/src/app/character/character.component.ts +++ b/apps/got-demo/src/app/character/character.component.ts @@ -1,12 +1,8 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'got-character', templateUrl: './character.component.html', styleUrls: ['./character.component.css'], }) -export class CharacterComponent implements OnInit { - constructor() {} - - ngOnInit(): void {} -} +export class CharacterComponent {} diff --git a/apps/got-demo/src/app/data.service.ts b/apps/got-demo/src/app/data.service.ts index 84e2bcd..f672ffc 100644 --- a/apps/got-demo/src/app/data.service.ts +++ b/apps/got-demo/src/app/data.service.ts @@ -1,11 +1,7 @@ import { Injectable } from '@angular/core'; -import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; -const options = { - headers: new HttpHeaders({ 'Content-Type': 'application/json' }), -}; - @Injectable({ providedIn: 'root', }) @@ -14,19 +10,19 @@ export class DataService { constructor(private http: HttpClient) {} - getBooks(): Observable { - return this.http.get(`${this.API}/books`); + getBooks(): Observable { + return this.http.get(`${this.API}/books`); } - getBook(id: string): Observable { - return this.http.get(`${this.API}/books/${id}`); + getBook(id: string): Observable { + return this.http.get(`${this.API}/books/${id}`); } - getCharacters(): Observable { - return this.http.get(`${this.API}/characters`); + getCharacters(): Observable { + return this.http.get(`${this.API}/characters`); } - getHouses(): Observable { - return this.http.get(`${this.API}/houses`); + getHouses(): Observable { + return this.http.get(`${this.API}/houses`); } } diff --git a/apps/got-demo/src/app/houses/houses.component.ts b/apps/got-demo/src/app/houses/houses.component.ts index 1f088f3..58fbb09 100644 --- a/apps/got-demo/src/app/houses/houses.component.ts +++ b/apps/got-demo/src/app/houses/houses.component.ts @@ -8,7 +8,7 @@ import { DataService } from '../data.service'; styleUrls: ['./houses.component.css'], }) export class HousesComponent implements OnInit { - houses$: Observable; + houses$: Observable; constructor(private dataService: DataService) {} ngOnInit(): void { diff --git a/libs/xng-breadcrumb/src/lib/types/breadcrumb.config.ts b/libs/xng-breadcrumb/src/lib/types/breadcrumb.config.ts index 1689ef6..3645c50 100644 --- a/libs/xng-breadcrumb/src/lib/types/breadcrumb.config.ts +++ b/libs/xng-breadcrumb/src/lib/types/breadcrumb.config.ts @@ -24,7 +24,7 @@ export interface BreadcrumbObject { /** * custom data for each breadcrumb that is passed back to ng-template */ - info?: any; + info?: unknown; /** * Interceptor for breadcrumb click action that returns the dynamic path * Consumers can change the breadcrumb routing dynamically with this approach diff --git a/libs/xng-breadcrumb/src/lib/types/breadcrumb.ts b/libs/xng-breadcrumb/src/lib/types/breadcrumb.ts index 4dd5597..41cb32a 100644 --- a/libs/xng-breadcrumb/src/lib/types/breadcrumb.ts +++ b/libs/xng-breadcrumb/src/lib/types/breadcrumb.ts @@ -20,7 +20,7 @@ export interface Breadcrumb { /** * Query params in string form. */ - queryParams?: any; + queryParams?: unknown; fragment?: string; routeInterceptor?: (routeLink: string, breadcrumb: Breadcrumb) => string; }