From 7edc159d2f916e3c3ca55e00e30e47663c03a3f9 Mon Sep 17 00:00:00 2001 From: Brandy Smith <6577830+brandyscarney@users.noreply.github.com> Date: Fri, 23 Oct 2026 12:08:33 -0400 Subject: [PATCH] chore(lint): fix lint warnings and fail lint on warnings --- eslint.config.js | 2 -- package.json | 2 +- src/app/services/photo.service.ts | 6 +++--- src/app/tab2/tab2.page.ts | 6 +++--- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index f59573c..a8a8929 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -13,8 +13,6 @@ module.exports = defineConfig([ extends: [angular.configs.tsRecommended], processor: angular.processInlineTemplates, rules: { - // Ionic's base level; `recommended` makes it an error, which is meant for libraries. - '@typescript-eslint/explicit-module-boundary-types': 'warn', '@angular-eslint/directive-selector': [ 'error', { diff --git a/package.json b/package.json index 21c3aee..6532402 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "test": "ng test", "lint": "npm run eslint && npm run prettier -- --check", "lint:fix": "npm run eslint -- --fix && npm run prettier -- --write", - "eslint": "ng lint", + "eslint": "ng lint --max-warnings 0", "prettier": "prettier \"**/*.{ts,html}\"" }, "private": true, diff --git a/src/app/services/photo.service.ts b/src/app/services/photo.service.ts index 111ea13..72935ab 100644 --- a/src/app/services/photo.service.ts +++ b/src/app/services/photo.service.ts @@ -25,7 +25,7 @@ export class PhotoService { // Store a reference to all photo filepaths using Storage API: // https://capacitor.ionicframework.com/docs/apis/storage */ - public async addNewToGallery() { + public async addNewToGallery(): Promise { // Take a photo const capturedPhoto = await Camera.getPhoto({ resultType: CameraResultType.Uri, // file-based data; provides best performance @@ -104,7 +104,7 @@ export class PhotoService { }); } - public async loadSaved() { + public async loadSaved(): Promise { // Retrieve cached photo array data const { value: photoList } = await Preferences.get({ key: this.PHOTO_STORAGE }); const photos = (photoList ? JSON.parse(photoList) : []) as UserPhoto[]; @@ -128,7 +128,7 @@ export class PhotoService { } // Delete picture by removing it from reference data and the filesystem - public async deletePhoto(photo: UserPhoto, position: number) { + public async deletePhoto(photo: UserPhoto, position: number): Promise { // Remove this photo from the Photos signal this.photos.update((photos) => photos.filter((_, index) => index !== position)); diff --git a/src/app/tab2/tab2.page.ts b/src/app/tab2/tab2.page.ts index 415579c..d9a47e0 100644 --- a/src/app/tab2/tab2.page.ts +++ b/src/app/tab2/tab2.page.ts @@ -33,15 +33,15 @@ export class Tab2Page implements OnInit { addIcons({ camera, trash, close }); } - async ngOnInit() { + async ngOnInit(): Promise { await this.photoService.loadSaved(); } - addPhotoToGallery() { + addPhotoToGallery(): void { this.photoService.addNewToGallery(); } - public async showActionSheet(photo: UserPhoto, position: number) { + public async showActionSheet(photo: UserPhoto, position: number): Promise { const actionSheet = await this.actionSheetController.create({ header: 'Photos', buttons: [