Skip to content

Commit

Permalink
feat: migrate to @cordova/eslint-config@3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed Jul 14, 2020
1 parent 358522c commit 32c5166
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 28 deletions.
31 changes: 22 additions & 9 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

root: true
extends: semistandard
rules:
indent:
- error
- 4
camelcase: off
padded-blocks: off
operator-linebreak: off
no-throw-literal: off
extends: '@cordova/eslint-config/browser'

overrides:
- files: [tests/**/*.js]
extends: '@cordova/eslint-config/node-tests'
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 32c5166

Please sign in to comment.