From d3b24da2e1bc4aa351c3060ba26a6ce3ba57fece Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 24 Jun 2017 05:11:54 -0700 Subject: [PATCH] lint: require strict mode. --- .eslintrc.json | 1 + lib/bip70/certs.js | 2 ++ lib/hd/words/chinese-simplified.js | 6 ++++-- lib/hd/words/chinese-traditional.js | 6 ++++-- lib/hd/words/english.js | 6 ++++-- lib/hd/words/french.js | 6 ++++-- lib/hd/words/italian.js | 6 ++++-- lib/hd/words/japanese.js | 6 ++++-- lib/hd/words/spanish.js | 2 ++ lib/mining/mine.js | 2 ++ lib/net/seeds/main.js | 2 ++ lib/net/seeds/testnet.js | 2 ++ lib/utils/nexttick-browser.js | 2 ++ lib/utils/nexttick.js | 2 ++ lib/utils/nfkd-browser.js | 2 ++ lib/utils/nfkd.js | 2 ++ scripts/certs.sh | 2 ++ scripts/seeds.sh | 2 ++ 18 files changed, 47 insertions(+), 12 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 77e73be9..36b8c60e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,6 +9,7 @@ "ecmaVersion": 8 }, "rules": { + "strict": 2, "indent": ["error", 2, { "SwitchCase": 1, "CallExpression": { diff --git a/lib/bip70/certs.js b/lib/bip70/certs.js index 88a7d008..d0c0d12a 100644 --- a/lib/bip70/certs.js +++ b/lib/bip70/certs.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = [ 'ebd41040e4bb3ec742c9e381d31ef2a41a48b6685c96e7cef3c1df6cd4331c99', 'ca42dd41745fd0b81eb902362cf9d8bf719da1bd1b1efc946f5b4c99f42c1b9e', diff --git a/lib/hd/words/chinese-simplified.js b/lib/hd/words/chinese-simplified.js index e3d024f5..82b35040 100644 --- a/lib/hd/words/chinese-simplified.js +++ b/lib/hd/words/chinese-simplified.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = [ '的', '一', @@ -2046,5 +2048,5 @@ module.exports = [ '韦', '怨', '矮', - '歇' -]; \ No newline at end of file + '歇' +]; diff --git a/lib/hd/words/chinese-traditional.js b/lib/hd/words/chinese-traditional.js index 7ee448e1..d33340da 100644 --- a/lib/hd/words/chinese-traditional.js +++ b/lib/hd/words/chinese-traditional.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = [ '的', '一', @@ -2046,5 +2048,5 @@ module.exports = [ '韋', '怨', '矮', - '歇' -]; \ No newline at end of file + '歇' +]; diff --git a/lib/hd/words/english.js b/lib/hd/words/english.js index 5f316341..7515a985 100644 --- a/lib/hd/words/english.js +++ b/lib/hd/words/english.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = [ 'abandon', 'ability', @@ -2046,5 +2048,5 @@ module.exports = [ 'zebra', 'zero', 'zone', - 'zoo' -]; \ No newline at end of file + 'zoo' +]; diff --git a/lib/hd/words/french.js b/lib/hd/words/french.js index 277c3c62..631f9b5b 100644 --- a/lib/hd/words/french.js +++ b/lib/hd/words/french.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = [ 'abaisser', 'abandon', @@ -2046,5 +2048,5 @@ module.exports = [ 'zèbre', 'zénith', 'zeste', - 'zoologie' -]; \ No newline at end of file + 'zoologie' +]; diff --git a/lib/hd/words/italian.js b/lib/hd/words/italian.js index 91eae367..adaa38b8 100644 --- a/lib/hd/words/italian.js +++ b/lib/hd/words/italian.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = [ 'abaco', 'abbaglio', @@ -2046,5 +2048,5 @@ module.exports = [ 'zucchero', 'zufolo', 'zulu', - 'zuppa' -]; \ No newline at end of file + 'zuppa' +]; diff --git a/lib/hd/words/japanese.js b/lib/hd/words/japanese.js index 7bfe2284..5d740edb 100644 --- a/lib/hd/words/japanese.js +++ b/lib/hd/words/japanese.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = [ 'あいこくしん', 'あいさつ', @@ -2046,5 +2048,5 @@ module.exports = [ 'わじまし', 'わすれもの', 'わらう', - 'われる' -]; \ No newline at end of file + 'われる' +]; diff --git a/lib/hd/words/spanish.js b/lib/hd/words/spanish.js index 94991587..8ac4ece3 100644 --- a/lib/hd/words/spanish.js +++ b/lib/hd/words/spanish.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = [ 'ábaco', 'abdomen', diff --git a/lib/mining/mine.js b/lib/mining/mine.js index 7d1a5d87..03af95fd 100644 --- a/lib/mining/mine.js +++ b/lib/mining/mine.js @@ -4,6 +4,8 @@ * https://github.com/bcoin-org/bcoin */ +'use strict'; + var assert = require('assert'); var crypto = require('../crypto/crypto'); diff --git a/lib/net/seeds/main.js b/lib/net/seeds/main.js index 1387a649..9cdf0cd1 100644 --- a/lib/net/seeds/main.js +++ b/lib/net/seeds/main.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = [ '2.7.8.12:8333', '2.228.70.198:8333', diff --git a/lib/net/seeds/testnet.js b/lib/net/seeds/testnet.js index a9ed269b..0af8ee69 100644 --- a/lib/net/seeds/testnet.js +++ b/lib/net/seeds/testnet.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = [ 'thfsmmn2jbitcoin.onion', 'it2pj4f7657g3rhi.onion', diff --git a/lib/utils/nexttick-browser.js b/lib/utils/nexttick-browser.js index 77e92d1b..eaecedc8 100644 --- a/lib/utils/nexttick-browser.js +++ b/lib/utils/nexttick-browser.js @@ -4,4 +4,6 @@ * https://github.com/bcoin-org/bcoin */ +'use strict'; + module.exports = require('../../vendor/setimmediate'); diff --git a/lib/utils/nexttick.js b/lib/utils/nexttick.js index 1ce33f81..0533c002 100644 --- a/lib/utils/nexttick.js +++ b/lib/utils/nexttick.js @@ -4,6 +4,8 @@ * https://github.com/bcoin-org/bcoin */ +'use strict'; + module.exports = typeof setImmediate !== 'function' ? process.nextTick : setImmediate; diff --git a/lib/utils/nfkd-browser.js b/lib/utils/nfkd-browser.js index 6ca17883..4d97e359 100644 --- a/lib/utils/nfkd-browser.js +++ b/lib/utils/nfkd-browser.js @@ -4,6 +4,8 @@ * https://github.com/bcoin-org/bcoin */ +'use strict'; + var unorm = require('../../vendor/unorm'); function nfkd(str) { diff --git a/lib/utils/nfkd.js b/lib/utils/nfkd.js index 92470ead..8ab57ba0 100644 --- a/lib/utils/nfkd.js +++ b/lib/utils/nfkd.js @@ -4,6 +4,8 @@ * https://github.com/bcoin-org/bcoin */ +'use strict'; + var unorm; /** diff --git a/scripts/certs.sh b/scripts/certs.sh index 4818c803..07e03014 100755 --- a/scripts/certs.sh +++ b/scripts/certs.sh @@ -49,6 +49,8 @@ tojs() { local data=$(cat) local body=$(echo "$data" | head -n -1) local last=$(echo "$data" | tail -n 1) + echo "'use strict';" + echo '' echo 'module.exports = [' echo "$body" | while read line; do echo " '${line}'," diff --git a/scripts/seeds.sh b/scripts/seeds.sh index 4cf2c313..c7044246 100755 --- a/scripts/seeds.sh +++ b/scripts/seeds.sh @@ -12,6 +12,8 @@ tojs() { local data=$(cat) local body=$(echo "$data" | head -n -1) local last=$(echo "$data" | tail -n 1) + echo "'use strict';" + echo '' echo 'module.exports = [' echo "$body" | while read line; do if echo "$line" | grep '^#' > /dev/null; then