From ed8cbd3fa20d7e3611698f7418dda9bdc6758a3f Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 9 Jul 2017 19:30:03 +0100 Subject: [PATCH 1/3] Update Makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 722b03a..d44873d 100644 --- a/Makefile +++ b/Makefile @@ -10,13 +10,13 @@ hooks: .git/hooks/pre-push .git/hooks/pre-push: hook.sh cp $< $@ -publish: +publish: npm-dep npm publish -test: +test: npm-dep npm run test -lint: +lint: npm-dep npm run lint npm-dep: From 96b27b9505e0c756e694bc0e543de92c5bc41478 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 9 Jul 2017 19:30:50 +0100 Subject: [PATCH 2/3] Clean up test/.eslintrc.js --- test/.eslintrc.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/.eslintrc.js b/test/.eslintrc.js index bf5793a..bf3479f 100644 --- a/test/.eslintrc.js +++ b/test/.eslintrc.js @@ -1,6 +1,5 @@ - module.exports = { env: { - mocha: true + mocha: true } }; From 51d70572b18a11eea0c5a13752319b2909375fb3 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 9 Jul 2017 19:41:48 +0100 Subject: [PATCH 3/3] Lint using semistandard --- .eslintrc.js | 7 ++----- package.json | 2 +- src/base58.js | 6 +++--- test/base58.test.js | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 44c4633..b358f6b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,10 +1,7 @@ module.exports = { - extends: 'flickr', - + extends: 'semistandard', env: { browser: true, node: true - }, - - rules: {} + } }; diff --git a/package.json b/package.json index 126d4d1..717e334 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "eslint": "^4.1.1", - "eslint-config-flickr": "^1.3.1", + "eslint-config-semistandard": "^11.0.0", "mocha": "^3.4.2" }, "scripts": { diff --git a/src/base58.js b/src/base58.js index aa6483c..52ed751 100644 --- a/src/base58.js +++ b/src/base58.js @@ -7,19 +7,19 @@ var alphabetLookup = alphabet.split('').reduce(function (lookup, char, index) { return lookup; }, {}); -function assertNonNegativeSafeInteger(val) { +function assertNonNegativeSafeInteger (val) { if (typeof val !== 'number' || isNaN(val) || val < 0 || val > Number.MAX_SAFE_INTEGER || Math.floor(val) !== val) { throw new Error('Value passed is not a non-negative safe integer.'); } } -function assertString(str) { +function assertString (str) { if (typeof str !== 'string') { throw new Error('Value passed is not a string.'); } } -function assertBase58Character(character) { +function assertBase58Character (character) { if (alphabetLookup[character] === undefined) { throw new Error('Value passed is not a valid Base58 string.'); } diff --git a/test/base58.test.js b/test/base58.test.js index a09ba55..604c873 100644 --- a/test/base58.test.js +++ b/test/base58.test.js @@ -2,7 +2,7 @@ var assert = require('assert'); var examples = require('./examples'); var base58 = require('..'); -function exampleRunner(callback) { +function exampleRunner (callback) { Object.keys(examples).forEach(function (str) { callback(str, examples[str]); });