Skip to content

Commit 8b78d3a

Browse files
committed
fixes
1 parent eeed82f commit 8b78d3a

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

.eslintrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
"no-console": "off",
1414
"strict": ["error", "global"],
1515
"curly": "warn"
16-
}
16+
},
17+
"ignorePatterns": [
18+
"*.min.js"
19+
]
1720
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"scripts": {
1212
"build": "webpack",
13+
"lint": "eslint src && eslint tests",
1314
"lint-tests": "eslint tests",
1415
"gen-tests": "npm run build && npm run clean-platform-tests && npm run mkdirp-platform-tests && npm run copy-platform-tests && npm run install-platform-tests",
1516
"clean-platform-tests": "trash ../cordova-plugin-test-projects/cordova-plugin-qrscanner-tests",

src/common/src/cordova-remap.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1+
/* eslint-disable no-redeclare, no-unused-vars */
12
// This file is generated by `npm run build`.
2-
3-
/*global exports:false*/
4-
/*jshint unused:false */
53
// remap parameter names from cordova.define
64
// see `externals` in webpack.cordova.config.js
7-
var cordovaRequire = require;
8-
var cordovaExports = exports;
9-
var cordovaModule = module;
5+
const cordovaRequire = require;
6+
const cordovaExports = exports;
7+
const cordovaModule = module;

src/windows/lib/preview.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function initialize() {
3434
}
3535

3636
function ensurePreviewInitialized() {
37-
if (!_.preview) initialize();
37+
if (!_.preview) { initialize(); }
3838
}
3939

4040
exports.setVideoUrl = function (videoUrl) {
@@ -73,7 +73,7 @@ exports.resume = function () {
7373
}
7474

7575
exports.isPlaying = function () {
76-
if (!_.preview) return false;
76+
if (!_.preview) { return false; }
7777
return !_.preview.capturePreview.paused;
7878
}
7979

@@ -85,4 +85,4 @@ exports.destroy = function () {
8585
}
8686
}
8787

88-
module.exports = exports;
88+
module.exports = exports;

src/windows/lib/qrScanner.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
/* global cordova, QRReader, WinJS */
2+
/*eslint no-unused-vars: ["error", { "args": "none" }]*/
3+
14
const preview = require('./preview');
25
const barcodeReader = new QRReader.Reader();
36
const VideoCapture = QRReader.VideoCapture;
47
const Promise = WinJS.Promise;
8+
let availableCameras
59

610
const errorTypes = {
711
UNEXPECTED_ERROR: 0,
@@ -50,7 +54,7 @@ function resetStatusFlags() {
5054
function reset() {
5155
document.body.removeEventListener('click', onPreviewClick);
5256
preview.destroy();
53-
if (currentVideoCapture) currentVideoCapture.destroy();
57+
if (currentVideoCapture) { currentVideoCapture.destroy(); }
5458
currentVideoCapture = null;
5559
availableCameras = null;
5660
resetStatusFlags();
@@ -210,7 +214,7 @@ qrScanner.scan = function () {
210214
}
211215

212216
qrScanner.cancelScan = function () {
213-
if (!statusFlags.scanning) return generateStatusResponse();
217+
if (!statusFlags.scanning) { return generateStatusResponse(); }
214218
statusFlags.scanning = false;
215219
barcodeReader.stop();
216220
return generateStatusResponse();
@@ -282,4 +286,4 @@ for (let property in qrScanner) {
282286

283287
module.exports = exports;
284288

285-
cordova.commandProxy.add("QRScanner", exports);
289+
cordova.commandProxy.add("QRScanner", exports);

0 commit comments

Comments
 (0)