From 0a73c59ea0f780ad8abdcd5e860ad262545108e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= <crazyserver@gmail.com>
Date: Wed, 29 Nov 2023 11:13:02 +0100
Subject: [PATCH 1/3] MOBILE-3947 chore: Linting fixes

---
 src/core/components/navbar-buttons/navbar-buttons.ts | 4 ++--
 src/core/components/tabs/tab.ts                      | 2 +-
 src/core/services/file.ts                            | 5 +++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/core/components/navbar-buttons/navbar-buttons.ts b/src/core/components/navbar-buttons/navbar-buttons.ts
index b63f656c1..f2a5c1c86 100644
--- a/src/core/components/navbar-buttons/navbar-buttons.ts
+++ b/src/core/components/navbar-buttons/navbar-buttons.ts
@@ -52,7 +52,7 @@ const BUTTON_HIDDEN_CLASS = 'core-navbar-button-hidden';
  */
 @Component({
     selector: 'core-navbar-buttons',
-    template: '<ng-content></ng-content><template #contextMenuContainer></template>',
+    template: '<ng-content></ng-content><template #contextMenuContainer>-</template>',
     styleUrls: ['navbar-buttons.scss'],
 })
 export class CoreNavBarButtonsComponent implements OnInit, OnDestroy {
@@ -62,7 +62,7 @@ export class CoreNavBarButtonsComponent implements OnInit, OnDestroy {
     // If the hidden input is true, hide all buttons.
     // eslint-disable-next-line @angular-eslint/no-input-rename
     @Input('hidden') set hidden(value: boolean) {
-        if (typeof value == 'string' && value == '') {
+        if (typeof value === 'string' && value === '') {
             value = true;
         }
         this.allButtonsHidden = value;
diff --git a/src/core/components/tabs/tab.ts b/src/core/components/tabs/tab.ts
index 6a9c7590b..d5c0be34e 100644
--- a/src/core/components/tabs/tab.ts
+++ b/src/core/components/tabs/tab.ts
@@ -41,7 +41,7 @@ import { CoreTabsComponent } from './tabs';
  */
 @Component({
     selector: 'core-tab',
-    template: '<ng-container *ngIf="loaded && template" [ngTemplateOutlet]="template"></ng-container>',
+    template: '<ng-container *ngIf="loaded && template" [ngTemplateOutlet]="template" />',
 })
 export class CoreTabComponent implements OnInit, OnDestroy, CoreTabBase {
 
diff --git a/src/core/services/file.ts b/src/core/services/file.ts
index 4a5e6659b..d26667369 100644
--- a/src/core/services/file.ts
+++ b/src/core/services/file.ts
@@ -23,11 +23,12 @@ import { CoreConstants } from '@/core/constants';
 import { CoreError } from '@classes/errors/error';
 
 import { CoreLogger } from '@singletons/logger';
-import { makeSingleton, File, Zip, WebView } from '@singletons';
+import { makeSingleton, File, WebView } from '@singletons';
 import { CoreFileEntry } from '@services/file-helper';
 import { CoreText } from '@singletons/text';
 import { CorePlatform } from '@services/platform';
 import { CorePath } from '@singletons/path';
+import { Zip } from '@features/native/plugins';
 
 /**
  * Progress event used when writing a file data into a file.
@@ -933,7 +934,7 @@ export class CoreFileProvider {
         // If destFolder is not set, use same location as ZIP file. We need to use absolute paths (including basePath).
         destFolder = this.addBasePathIfNeeded(destFolder || CoreMimetypeUtils.removeExtension(path));
 
-        const result = await Zip.unzip(fileEntry.toURL(), destFolder, onProgress as unknown as Function);
+        const result = await Zip.unzip(fileEntry.toURL(), destFolder, onProgress);
 
         if (result == -1) {
             throw new CoreError('Unzip failed.');

From ec87e0c8776dae4a3a01903a3cb3ed0853b535eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= <crazyserver@gmail.com>
Date: Wed, 29 Nov 2023 15:33:10 +0100
Subject: [PATCH 2/3] MOBILE-3947 chore: Remove unneeded HammerJS config
 override

---
 src/core/classes/hammer-gesture-config.ts | 27 -----------------------
 src/core/core.module.ts                   |  4 ----
 2 files changed, 31 deletions(-)
 delete mode 100644 src/core/classes/hammer-gesture-config.ts

diff --git a/src/core/classes/hammer-gesture-config.ts b/src/core/classes/hammer-gesture-config.ts
deleted file mode 100644
index de832aa37..000000000
--- a/src/core/classes/hammer-gesture-config.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-// (C) Copyright 2015 Moodle Pty Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import { HammerGestureConfig } from '@angular/platform-browser';
-import { DIRECTION_ALL } from 'hammerjs';
-
-/**
- * Application HammerJS config.
- */
-export class CoreHammerGestureConfig extends HammerGestureConfig {
-
-    overrides = {
-        swipe: { direction: DIRECTION_ALL },
-    };
-
-}
diff --git a/src/core/core.module.ts b/src/core/core.module.ts
index 44ca6128e..7caca92ca 100644
--- a/src/core/core.module.ts
+++ b/src/core/core.module.ts
@@ -14,11 +14,9 @@
 
 import { HTTP_INTERCEPTORS } from '@angular/common/http';
 import { ApplicationInitStatus, Injector, NgModule, Type } from '@angular/core';
-import { HammerModule, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
 
 import { CoreApplicationInitStatus } from './classes/application-init-status';
 import { CoreFeaturesModule } from './features/features.module';
-import { CoreHammerGestureConfig } from './classes/hammer-gesture-config';
 import { CoreInterceptor } from './classes/interceptor';
 import { getDatabaseProviders } from './services/database';
 import { getInitializerProviders } from './initializers';
@@ -84,11 +82,9 @@ export const CORE_SERVICES: Type<unknown>[] = [
 @NgModule({
     imports: [
         CoreFeaturesModule,
-        HammerModule,
     ],
     providers: [
         { provide: HTTP_INTERCEPTORS, useClass: CoreInterceptor, multi: true },
-        { provide: HAMMER_GESTURE_CONFIG, useClass: CoreHammerGestureConfig },
         { provide: ApplicationInitStatus, useClass: CoreApplicationInitStatus, deps: [Injector] },
         ...getDatabaseProviders(),
         ...getInitializerProviders(),

From 9c04323979856ac3a96ae06052f0b8043e48ef9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= <crazyserver@gmail.com>
Date: Thu, 30 Nov 2023 11:01:39 +0100
Subject: [PATCH 3/3] MOBILE-3947 lint: Add process-inline-templates rules

---
 .eslintrc.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.eslintrc.js b/.eslintrc.js
index 6007c251e..22e062468 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -17,6 +17,7 @@ const appConfig = {
         'plugin:@typescript-eslint/eslint-recommended',
         'plugin:@typescript-eslint/recommended',
         'plugin:@angular-eslint/recommended',
+        'plugin:@angular-eslint/template/process-inline-templates',
         'plugin:promise/recommended',
         'plugin:jsdoc/recommended',
         'plugin:deprecation/recommended',