Skip to content

Commit 5277adb

Browse files
committed
fix(web): linting issues
1 parent 771820c commit 5277adb

3 files changed

Lines changed: 29 additions & 29 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Install dependencies
3838
run: npm ci
3939

40-
- name: Run Lint script
40+
- name: Run Lint
4141
run: npm run lint
4242

4343
verify-ios:

src/types.d.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,44 @@ declare global {
66
* Barcode Detection API. This list may change in the future.
77
* Adapted from: https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API
88
*/
9-
type BarcodeFormat = 'aztec'
10-
| 'code_128'
11-
| 'code_39'
12-
| 'code_93'
13-
| 'codabar'
14-
| 'data_matrix'
15-
| 'ean_13'
16-
| 'ean_8'
17-
| 'itf'
18-
| 'pdf417'
19-
| 'qr_code'
20-
| 'upc_a'
21-
| 'upc_e'
9+
type BarcodeFormat = 'aztec'
10+
| 'code_128'
11+
| 'code_39'
12+
| 'code_93'
13+
| 'codabar'
14+
| 'data_matrix'
15+
| 'ean_13'
16+
| 'ean_8'
17+
| 'itf'
18+
| 'pdf417'
19+
| 'qr_code'
20+
| 'upc_a'
21+
| 'upc_e'
2222
| 'unknown';
2323

2424
/**
2525
* The return type of the Barcode Detect API `detect` function that
2626
* describes a barcode that has been recognized by the API.
2727
*/
2828
interface DetectedBarcode {
29-
/**
29+
/**
3030
* A DOMRectReadOnly, which returns the dimensions of a rectangle
3131
* representing the extent of a detected barcode, aligned with the
32-
* image
32+
* image
3333
*/
3434
boundingBox: DOMRectReadOnly;
3535

3636
/**
3737
* The x and y co-ordinates of the four corner points of the detected
3838
* barcode relative to the image, starting with the top left and working
3939
* clockwise. This may not be square due to perspective distortions
40-
* within the image.
40+
* within the image.
4141
*/
42-
cornerPoints: Array<{
42+
cornerPoints: {
4343
x: number,
4444
y: number,
45-
}>;
46-
45+
}[];
46+
4747
/**
4848
* The detected barcode format
4949
*/
@@ -59,8 +59,8 @@ declare global {
5959
* Options for describing how a BarcodeDetector should be initialised
6060
*/
6161
interface BarcodeDetectorOptions {
62-
/**
63-
* Which formats the barcode detector should detect
62+
/**
63+
* Which formats the barcode detector should detect
6464
*/
6565
formats: BarcodeFormat[];
6666
}
@@ -70,18 +70,18 @@ declare global {
7070
* detection of linear and two dimensional barcodes in images.
7171
*/
7272
class BarcodeDetector {
73-
/**
74-
* Initialize a Barcode Detector instance
73+
/**
74+
* Initialize a Barcode Detector instance
7575
*/
7676
constructor(options?: BarcodeDetectorOptions);
7777

7878
/**
79-
* Retrieve the formats that are supported by the detector
79+
* Retrieve the formats that are supported by the detector
8080
*/
8181
static getSupportedFormats(): Promise<BarcodeFormat[]>;
8282

83-
/**
84-
* Attempt to detect barcodes from an image source
83+
/**
84+
* Attempt to detect barcodes from an image source
8585
*/
8686
public detect(source: ImageBitmapSource): Promise<DetectedBarcode[]>;
8787
}

src/web.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,11 @@ export class CameraViewWeb extends WebPlugin implements CameraViewPlugin {
381381
/**
382382
* Clean up resources when the plugin is disposed
383383
*/
384-
public async handleOnDestroy() {
384+
public async handleOnDestroy(): Promise<void> {
385385
await this.stop();
386386

387387
// Remove elements from DOM
388-
if (this.videoElement && this.videoElement.parentNode) {
388+
if (this.videoElement?.parentNode) {
389389
this.videoElement.parentNode.removeChild(this.videoElement);
390390
this.videoElement = null;
391391
}

0 commit comments

Comments
 (0)