Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/app/services/photo.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
// Take a photo
const capturedPhoto = await Camera.getPhoto({
resultType: CameraResultType.Uri, // file-based data; provides best performance
Expand Down Expand Up @@ -104,7 +104,7 @@ export class PhotoService {
});
}

public async loadSaved() {
public async loadSaved(): Promise<void> {
// Retrieve cached photo array data
const { value: photoList } = await Preferences.get({ key: this.PHOTO_STORAGE });
const photos = (photoList ? JSON.parse(photoList) : []) as UserPhoto[];
Expand All @@ -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<void> {
// Remove this photo from the Photos signal
this.photos.update((photos) => photos.filter((_, index) => index !== position));

Expand Down
6 changes: 3 additions & 3 deletions src/app/tab2/tab2.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export class Tab2Page implements OnInit {
addIcons({ camera, trash, close });
}

async ngOnInit() {
async ngOnInit(): Promise<void> {
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<void> {
const actionSheet = await this.actionSheetController.create({
header: 'Photos',
buttons: [
Expand Down
Loading