You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2019/11/15 02:07:08 UTC
[cordova-fetch] branch master updated: refactor: eslint setup (#70)
This is an automated email from the ASF dual-hosted git repository.
erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-fetch.git
The following commit(s) were added to refs/heads/master by this push:
new e5aba07 refactor: eslint setup (#70)
e5aba07 is described below
commit e5aba078e1f43cf722d19049e9e9621c21ae107b
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Fri Nov 15 11:06:59 2019 +0900
refactor: eslint setup (#70)
* replace dependencies with @cordova/eslint-config
* update eslint config
* eslint corrections
---
.eslintrc.yml | 10 +---------
.travis.yml | 2 ++
package.json | 12 +++---------
spec/.eslintrc.yml | 6 ++----
spec/fetch-unit.spec.js | 2 +-
spec/fetch.spec.js | 4 ----
6 files changed, 9 insertions(+), 27 deletions(-)
diff --git a/.eslintrc.yml b/.eslintrc.yml
index f6aae32..3a6b031 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -1,10 +1,2 @@
root: true
-extends: semistandard
-rules:
- indent:
- - error
- - 4
- camelcase: off
- padded-blocks: off
- operator-linebreak: off
- no-throw-literal: off
+extends: '@cordova/eslint-config/node'
diff --git a/.travis.yml b/.travis.yml
index c29410d..21696b8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,9 @@
language: node_js
sudo: false
+
git:
depth: 10
+
node_js:
- 10
- 12
diff --git a/package.json b/package.json
index b95de33..392313c 100644
--- a/package.json
+++ b/package.json
@@ -30,22 +30,16 @@
"which": "^1.3.1"
},
"devDependencies": {
- "eslint": "^5.15.2",
- "eslint-config-semistandard": "^13.0.0",
- "eslint-config-standard": "^12.0.0",
- "eslint-plugin-import": "^2.16.0",
- "eslint-plugin-node": "^8.0.1",
- "eslint-plugin-promise": "^4.0.1",
- "eslint-plugin-standard": "^4.0.0",
+ "@cordova/eslint-config": "^2.0.0",
"file-url": "^3.0.0",
"jasmine": "^3.5.0",
"nyc": "^14.1.1",
"rewire": "^4.0.1"
},
"scripts": {
- "test": "npm run eslint && npm run cover",
+ "test": "npm run lint && npm run cover",
"cover": "nyc jasmine",
- "eslint": "eslint --ignore-path .gitignore ."
+ "lint": "eslint --ignore-path .gitignore ."
},
"engines": {
"node": ">= 10",
diff --git a/spec/.eslintrc.yml b/spec/.eslintrc.yml
index 77cb525..f2c42a4 100644
--- a/spec/.eslintrc.yml
+++ b/spec/.eslintrc.yml
@@ -1,4 +1,2 @@
-env:
- jasmine: true
-rules:
- prefer-promise-reject-errors: off
+root: true
+extends: '@cordova/eslint-config/node-tests'
diff --git a/spec/fetch-unit.spec.js b/spec/fetch-unit.spec.js
index 3e26821..99922c3 100644
--- a/spec/fetch-unit.spec.js
+++ b/spec/fetch-unit.spec.js
@@ -40,7 +40,7 @@ describe('fetch', function () {
});
it('should install package if not found', function () {
- fetch.__set__({ pathToInstalledPackage: _ => Promise.reject() });
+ fetch.__set__({ pathToInstalledPackage: _ => Promise.reject(new Error()) });
return fetch('foo', 'bar').then(result => {
expect(result).toBe('/foo');
diff --git a/spec/fetch.spec.js b/spec/fetch.spec.js
index 6cb7846..6e2adab 100644
--- a/spec/fetch.spec.js
+++ b/spec/fetch.spec.js
@@ -61,7 +61,6 @@ function expectDevDependenciesToBe (deps) {
}
describe('fetch/uninstall tests via npm & git', function () {
-
it('should fetch and uninstall a cordova platform via npm & git', function () {
return Promise.resolve()
.then(_ => fetchAndMatch('cordova-android'))
@@ -79,7 +78,6 @@ describe('fetch/uninstall tests via npm & git', function () {
});
describe('fetch/uninstall with --save', function () {
-
beforeEach(function () {
opts = { save: true };
// copy package.json from spec directory to tmpDir
@@ -132,7 +130,6 @@ describe('fetch/uninstall with --save', function () {
});
describe('fetching already installed packages', function () {
-
beforeEach(function () {
fs.copySync(path.join(__dirname, 'support'), 'support');
});
@@ -166,7 +163,6 @@ describe('fetching already installed packages', function () {
});
describe('negative tests', function () {
-
it('should fail fetching a module that does not exist on npm', function () {
return fetch('NOTAMODULE', tmpDir, opts)
.then(function (result) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org