Skip to content

Commit

Permalink
feat: migrate to @cordova/eslint-config@3.x (apache#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu authored and IT-MikeS committed Mar 18, 2024
1 parent 411abf3 commit eebaf64
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"cordova-osx"
],
"scripts": {
"test": "npm run eslint",
"eslint": "node node_modules/eslint/bin/eslint www && node node_modules/eslint/bin/eslint src && node node_modules/eslint/bin/eslint tests"
"test": "npm run lint",
"lint": "eslint ."
},
"author": "Apache Software Foundation",
"license": "Apache-2.0",
Expand All @@ -51,12 +51,6 @@
}
},
"devDependencies": {
"eslint": "^4.3.0",
"eslint-config-semistandard": "^11.0.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-node": "^5.0.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1"
"@cordova/eslint-config": "^3.0.0"
}
}
2 changes: 1 addition & 1 deletion src/browser/CameraProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function capture (success, errorCallback, opts) {
};

if (navigator.getUserMedia) {
navigator.getUserMedia({video: true, audio: false}, successCallback, errorCallback);
navigator.getUserMedia({ video: true, audio: false }, successCallback, errorCallback);
} else {
alert('Browser does not support camera :(');
}
Expand Down
5 changes: 1 addition & 4 deletions src/windows/CameraProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ function takePictureFromCameraWP (successCallback, errorCallback, args) {

return capture.initializeAsync(captureSettings);
}).then(function () {

// create focus control if available
var VideoDeviceController = capture.videoDeviceController;
var FocusControl = VideoDeviceController.focusControl;
Expand Down Expand Up @@ -477,7 +476,6 @@ function takePictureFromCameraWP (successCallback, errorCallback, args) {
}

function captureAction () {

var encodingProperties;
var fileName;
var tempFolder = getAppData().temporaryFolder;
Expand Down Expand Up @@ -715,7 +713,7 @@ function takePictureFromCameraWindows (successCallback, errorCallback, args) {

if (targetWidth === -1 && targetHeight === -1) {
maxRes = UIMaxRes.highestAvailable;
// Temp fix for CB-10539
// Temp fix for CB-10539
/* else if (totalPixels <= 320 * 240) {
maxRes = UIMaxRes.verySmallQvga;
} */
Expand Down Expand Up @@ -812,7 +810,6 @@ function savePhoto (picture, options, successCallback, errorCallback) {

if (!options.saveToPhotoAlbum) {
success(picture);

} else {
var savePicker = new Windows.Storage.Pickers.FileSavePicker();
var saveFile = function (file) {
Expand Down
8 changes: 4 additions & 4 deletions tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {

var options = '';
if (typeof values === 'boolean') {
values = { 'true': 1, 'false': 0 };
values = { true: 1, false: 0 };
}
for (var k in values) {
var isSelected = '';
Expand Down Expand Up @@ -409,9 +409,9 @@ exports.defineManualTests = function (contentEl, createActionButton) {
createOptionsEl('destinationType', Camera.DestinationType, camDestinationTypeDefault) +
createOptionsEl('encodingType', Camera.EncodingType, camEncodingTypeDefault) +
createOptionsEl('mediaType', Camera.MediaType, camMediaTypeDefault) +
createOptionsEl('quality', { '0': 0, '50': 50, '80': 80, '100': 100 }, camQualityDefault) +
createOptionsEl('targetWidth', { '50': 50, '200': 200, '800': 800, '2048': 2048 }) +
createOptionsEl('targetHeight', { '50': 50, '200': 200, '800': 800, '2048': 2048 }) +
createOptionsEl('quality', { 0: 0, 50: 50, 80: 80, 100: 100 }, camQualityDefault) +
createOptionsEl('targetWidth', { 50: 50, 200: 200, 800: 800, 2048: 2048 }) +
createOptionsEl('targetHeight', { 50: 50, 200: 200, 800: 800, 2048: 2048 }) +
createOptionsEl('allowEdit', true, camAllowEditDefault) +
createOptionsEl('correctOrientation', true, camCorrectOrientationDefault) +
createOptionsEl('saveToPhotoAlbum', true, camSaveToPhotoAlbumDefault) +
Expand Down
2 changes: 1 addition & 1 deletion www/ios/CameraPopoverHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var CameraPopoverHandle = function () {
* @param {module:CameraPopoverOptions} popoverOptions
*/
this.setPosition = function (popoverOptions) {
var args = [ popoverOptions ];
var args = [popoverOptions];
exec(null, null, 'Camera', 'repositionPopover', args);
};
};
Expand Down

0 comments on commit eebaf64

Please sign in to comment.