Skip to content

Commit

Permalink
refactor(eslint): use cordova-eslint (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
breautek committed Jun 8, 2020
1 parent 9f85270 commit ed8f15e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 25 deletions.
32 changes: 23 additions & 9 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -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
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'
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ before_script:
- |
if [[ "$TRAVIS_REPO_SLUG" =~ cordova-paramedic ]]; then
# 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_COMMAND="node main.js"
else
Expand Down
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"cordova-browser"
],
"scripts": {
"test": "npm run eslint",
"eslint": "eslint www && eslint src && eslint tests"
"test": "npm run lint",
"lint": "eslint ."
},
"author": "Apache Software Foundation",
"license": "Apache-2.0",
Expand All @@ -43,12 +43,6 @@
}
},
"devDependencies": {
"eslint": "^4.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"
"@cordova/eslint-config": "^3.0.0"
}
}
1 change: 0 additions & 1 deletion src/windows/NetworkInfoProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var winNetConn = Windows.Networking.Connectivity;
var networkInfo = winNetConn.NetworkInformation;

function getCurrrentConnectionType () {

var profile = networkInfo.getInternetConnectionProfile();

if (!profile) {
Expand Down
10 changes: 5 additions & 5 deletions tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ exports.defineAutoTests = function () {

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

0 comments on commit ed8f15e

Please sign in to comment.