refactor(eslint): use cordova-eslint (#115)

This commit is contained in:
Norman Breau 2020-06-08 12:44:54 -03:00 committed by GitHub
parent 9f85270627
commit ed8f15e91d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 25 deletions

View File

@ -1,10 +1,24 @@
# 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 root: true
extends: semistandard
rules: extends: '@cordova/eslint-config/browser'
indent:
- error overrides:
- 4 - files: [tests/**/*.js]
camelcase: off extends: '@cordova/eslint-config/node-tests'
padded-blocks: off
operator-linebreak: off
no-throw-literal: off

View File

@ -92,7 +92,7 @@ before_script:
- | - |
if [[ "$TRAVIS_REPO_SLUG" =~ cordova-paramedic ]]; then if [[ "$TRAVIS_REPO_SLUG" =~ cordova-paramedic ]]; then
# when used in the cordova-paramedic repo # when used in the cordova-paramedic repo
TEST_COMMAND="npm run eslint" TEST_COMMAND="npm run lint"
PARAMEDIC_PLUGIN_TO_TEST="./spec/testable-plugin/" PARAMEDIC_PLUGIN_TO_TEST="./spec/testable-plugin/"
PARAMEDIC_COMMAND="node main.js" PARAMEDIC_COMMAND="node main.js"
else else

View File

@ -30,8 +30,8 @@
"cordova-browser" "cordova-browser"
], ],
"scripts": { "scripts": {
"test": "npm run eslint", "test": "npm run lint",
"eslint": "eslint www && eslint src && eslint tests" "lint": "eslint ."
}, },
"author": "Apache Software Foundation", "author": "Apache Software Foundation",
"license": "Apache-2.0", "license": "Apache-2.0",
@ -43,12 +43,6 @@
} }
}, },
"devDependencies": { "devDependencies": {
"eslint": "^4.0.0", "@cordova/eslint-config": "^3.0.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"
} }
} }

View File

@ -27,7 +27,6 @@ var winNetConn = Windows.Networking.Connectivity;
var networkInfo = winNetConn.NetworkInformation; var networkInfo = winNetConn.NetworkInformation;
function getCurrrentConnectionType () { function getCurrrentConnectionType () {
var profile = networkInfo.getInternetConnectionProfile(); var profile = networkInfo.getInternetConnectionProfile();
if (!profile) { if (!profile) {

View File

@ -31,14 +31,14 @@ exports.defineAutoTests = function () {
it('network.spec.2 should be set to a valid value', function () { it('network.spec.2 should be set to a valid value', function () {
var validValues = { var validValues = {
'unknown': 1, unknown: 1,
'ethernet': 1, ethernet: 1,
'wifi': 1, wifi: 1,
'2g': 1, '2g': 1,
'cellular': 1, cellular: 1,
'3g': 1, '3g': 1,
'4g': 1, '4g': 1,
'none': 1 none: 1
}; };
expect(validValues[navigator.connection.type]).toBe(1); expect(validValues[navigator.connection.type]).toBe(1);
}); });