Skip to content

Commit 47b2c48

Browse files
committed
iOS - app crashes when plugin stop is called #387 (WIP)
Changes: - updated some of the example-app dependencies - migrated to eslint 9 - fixed lint errors
1 parent b235440 commit 47b2c48

File tree

14 files changed

+2909
-5644
lines changed

14 files changed

+2909
-5644
lines changed

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

android/src/main/java/com/ahm/capacitor/camera/preview/CameraActivity.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ private void createCameraPreview() {
159159
private void setupTouchAndBackButton() {
160160
final GestureDetector gestureDetector = new GestureDetector(getActivity().getApplicationContext(), new TapGestureDetector());
161161

162-
getActivity()
163-
.runOnUiThread(
162+
getActivity().runOnUiThread(
164163
new Runnable() {
165164
@Override
166165
public void run() {

eslint.config.mjs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import js from '@eslint/js';
2+
import tseslint from '@typescript-eslint/eslint-plugin';
3+
import parser from '@typescript-eslint/parser';
4+
5+
export default [
6+
js.configs.recommended,
7+
8+
{
9+
files: ['**/*.ts'],
10+
languageOptions: {
11+
parser,
12+
parserOptions: {
13+
ecmaVersion: 'latest',
14+
sourceType: 'module',
15+
},
16+
},
17+
plugins: {
18+
'@typescript-eslint': tseslint,
19+
},
20+
rules: {
21+
...tseslint.configs.recommended.rules,
22+
},
23+
},
24+
25+
// Web-specific override for browser globals
26+
{
27+
files: ['src/web.ts'],
28+
languageOptions: {
29+
globals: {
30+
window: 'readonly',
31+
navigator: 'readonly',
32+
document: 'readonly',
33+
HTMLVideoElement: 'readonly',
34+
MediaStream: 'readonly',
35+
MediaStreamConstraints: 'readonly',
36+
MediaTrackConstraints: 'readonly',
37+
},
38+
},
39+
rules: {
40+
'@typescript-eslint/no-explicit-any': 'off', // optional
41+
},
42+
},
43+
];

example-app/.browserslistrc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
# You can see what browsers were selected by your queries by running:
99
# npx browserslist
1010

11-
Chrome >=79
12-
ChromeAndroid >=79
13-
Firefox >=70
14-
Edge >=79
15-
Safari >=14
16-
iOS >=14
11+
Chrome >=107
12+
Firefox >=106
13+
Edge >=107
14+
Safari >=16.1
15+
iOS >=16.1

example-app/angular.json

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"prefix": "app",
1717
"architect": {
1818
"build": {
19-
"builder": "@angular-devkit/build-angular:application",
19+
"builder": "@angular/build:application",
2020
"options": {
2121
"outputPath": {
2222
"base": "www"
@@ -73,7 +73,7 @@
7373
"defaultConfiguration": "production"
7474
},
7575
"serve": {
76-
"builder": "@angular-devkit/build-angular:dev-server",
76+
"builder": "@angular/build:dev-server",
7777
"configurations": {
7878
"production": {
7979
"buildTarget": "app:build:production"
@@ -88,13 +88,13 @@
8888
"defaultConfiguration": "development"
8989
},
9090
"extract-i18n": {
91-
"builder": "@angular-devkit/build-angular:extract-i18n",
91+
"builder": "@angular/build:extract-i18n",
9292
"options": {
9393
"buildTarget": "app:build"
9494
}
9595
},
9696
"test": {
97-
"builder": "@angular-devkit/build-angular:karma",
97+
"builder": "@angular/build:karma",
9898
"options": {
9999
"main": "src/test.ts",
100100
"polyfills": "src/polyfills.ts",
@@ -142,6 +142,30 @@
142142
},
143143
"@angular-eslint/schematics:library": {
144144
"setParserOptionsProject": true
145+
},
146+
"@schematics/angular:component": {
147+
"type": "component"
148+
},
149+
"@schematics/angular:directive": {
150+
"type": "directive"
151+
},
152+
"@schematics/angular:service": {
153+
"type": "service"
154+
},
155+
"@schematics/angular:guard": {
156+
"typeSeparator": "."
157+
},
158+
"@schematics/angular:interceptor": {
159+
"typeSeparator": "."
160+
},
161+
"@schematics/angular:module": {
162+
"typeSeparator": "."
163+
},
164+
"@schematics/angular:pipe": {
165+
"typeSeparator": "."
166+
},
167+
"@schematics/angular:resolver": {
168+
"typeSeparator": "."
145169
}
146170
}
147171
}

example-app/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = function (config) {
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
1212
require('karma-coverage'),
13-
require('@angular-devkit/build-angular/plugins/karma')
13+
1414
],
1515
client: {
1616
jasmine: {

0 commit comments

Comments
 (0)