lint everything using standard

This commit is contained in:
Evert Prants 2017-08-24 19:23:03 +03:00
parent 3b59865eb5
commit 772d6aab1e
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
18 changed files with 323 additions and 188 deletions

View File

@ -1,5 +1,5 @@
exports.up = function(knex, Promise) {
exports.up = function (knex, Promise) {
return Promise.all([
knex.schema.createTable('users', (table) => {
table.increments('id').primary()
@ -162,7 +162,7 @@ exports.up = function(knex, Promise) {
])
}
exports.down = function(knex, Promise) {
exports.down = function (knex, Promise) {
return Promise.all([
knex.schema.dropTable('sessions'),
knex.schema.dropTable('users'),

344
package-lock.json generated
View File

@ -60,6 +60,12 @@
"json-stable-stringify": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz"
}
},
"ajv-keywords": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz",
"integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=",
"dev": true
},
"align-text": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
@ -167,7 +173,7 @@
"dev": true,
"requires": {
"define-properties": "1.1.2",
"es-abstract": "1.7.0"
"es-abstract": "1.8.0"
}
},
"arrify": {
@ -863,9 +869,9 @@
}
},
"circular-json": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.1.tgz",
"integrity": "sha1-vos2rvzN6LPKeqLWr8B6NyQsDS0=",
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz",
"integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==",
"dev": true
},
"clean-css": {
@ -905,9 +911,9 @@
}
},
"cli-width": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz",
"integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz",
"integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=",
"dev": true
},
"cliui": {
@ -1292,7 +1298,7 @@
"integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=",
"dev": true,
"requires": {
"es5-ext": "0.10.24"
"es5-ext": "0.10.29"
}
},
"dashdash": {
@ -1665,13 +1671,14 @@
}
},
"es-abstract": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.7.0.tgz",
"integrity": "sha1-363ndOAb/Nl/lhgCmMRJyGI/uUw=",
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.8.0.tgz",
"integrity": "sha512-Cf9/h5MrXtExM20gSS55YFrGKCyPrRBjIVBtVyy8vmlsDfe0NPKMWj65tPLgzyfPuapWxh5whpXCtW4+AW5mRg==",
"dev": true,
"requires": {
"es-to-primitive": "1.1.1",
"function-bind": "1.1.0",
"has": "1.0.1",
"is-callable": "1.1.3",
"is-regex": "1.0.4"
}
@ -1688,9 +1695,9 @@
}
},
"es5-ext": {
"version": "0.10.24",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.24.tgz",
"integrity": "sha1-pVh3yZJLwMjZvTwsvhdJWsFwmxQ=",
"version": "0.10.29",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.29.tgz",
"integrity": "sha512-KXla9NXo5sdaEkGSmbFPYgjH6m75kxsthL6GDRSug/Y2OiMoYm0I9giL39j4cgmaFmAbkIFJ6gG+SGKnLSmOvA==",
"dev": true,
"requires": {
"es6-iterator": "2.0.1",
@ -1704,7 +1711,7 @@
"dev": true,
"requires": {
"d": "1.0.0",
"es5-ext": "0.10.24",
"es5-ext": "0.10.29",
"es6-symbol": "3.1.1"
}
},
@ -1715,7 +1722,7 @@
"dev": true,
"requires": {
"d": "1.0.0",
"es5-ext": "0.10.24",
"es5-ext": "0.10.29",
"es6-iterator": "2.0.1",
"es6-set": "0.1.5",
"es6-symbol": "3.1.1",
@ -1729,7 +1736,7 @@
"dev": true,
"requires": {
"d": "1.0.0",
"es5-ext": "0.10.24",
"es5-ext": "0.10.29",
"es6-iterator": "2.0.1",
"es6-symbol": "3.1.1",
"event-emitter": "0.3.5"
@ -1742,7 +1749,7 @@
"dev": true,
"requires": {
"d": "1.0.0",
"es5-ext": "0.10.24"
"es5-ext": "0.10.29"
}
},
"es6-weak-map": {
@ -1752,7 +1759,7 @@
"dev": true,
"requires": {
"d": "1.0.0",
"es5-ext": "0.10.24",
"es5-ext": "0.10.29",
"es6-iterator": "2.0.1",
"es6-symbol": "3.1.1"
}
@ -1789,7 +1796,7 @@
"debug": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
"doctrine": "2.0.0",
"escope": "3.6.0",
"espree": "3.4.3",
"espree": "3.5.0",
"esquery": "1.0.0",
"estraverse": "4.2.0",
"esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
@ -1799,9 +1806,9 @@
"ignore": "3.3.3",
"imurmurhash": "0.1.4",
"inquirer": "0.12.0",
"is-my-json-valid": "2.16.0",
"is-my-json-valid": "2.16.1",
"is-resolvable": "1.0.0",
"js-yaml": "3.9.0",
"js-yaml": "3.9.1",
"json-stable-stringify": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
"levn": "0.3.0",
"lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
@ -1831,14 +1838,25 @@
}
}
},
"eslint-config-standard": {
"version": "10.2.1",
"resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz",
"integrity": "sha1-wGHk0GbzedwXzVYsZOgZtN1FRZE=",
"dev": true
},
"eslint-config-standard-jsx": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-4.0.2.tgz",
"integrity": "sha512-F8fRh2WFnTek7dZH9ZaE0PCBwdVGkwVWZmizla/DDNOmg7Tx6B/IlK5+oYpiX29jpu73LszeJj5i1axEZv6VMw==",
"dev": true
},
"eslint-import-resolver-node": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz",
"integrity": "sha1-Wt2BBujJKNssuiMrzZ76hG49oWw=",
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz",
"integrity": "sha512-yUtXS15gIcij68NmXmP9Ni77AQuCN0itXbCc/jWd8C6/yKZaSNXicpC8cgvjnxVdmfsosIXrjpzFq7GcDryb6A==",
"dev": true,
"requires": {
"debug": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
"object-assign": "4.1.1",
"resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz"
}
},
@ -1852,16 +1870,90 @@
"pkg-dir": "1.0.0"
}
},
"eslint-plugin-import": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.7.0.tgz",
"integrity": "sha512-HGYmpU9f/zJaQiKNQOVfHUh2oLWW3STBrCgH0sHTX1xtsxYlH1zjLh8FlQGEIdZSdTbUMaV36WaZ6ImXkenGxQ==",
"dev": true,
"requires": {
"builtin-modules": "1.1.1",
"contains-path": "0.1.0",
"debug": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
"doctrine": "1.5.0",
"eslint-import-resolver-node": "0.3.1",
"eslint-module-utils": "2.1.1",
"has": "1.0.1",
"lodash.cond": "4.5.2",
"minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"read-pkg-up": "2.0.0"
},
"dependencies": {
"doctrine": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
"dev": true,
"requires": {
"esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
"isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz"
}
}
}
},
"eslint-plugin-node": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-4.2.3.tgz",
"integrity": "sha512-vIUQPuwbVYdz/CYnlTLsJrRy7iXHQjdEe5wz0XhhdTym3IInM/zZLlPf9nZ2mThsH0QcsieCOWs2vOeCy/22LQ==",
"dev": true,
"requires": {
"ignore": "3.3.3",
"minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"object-assign": "4.1.1",
"resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz",
"semver": "5.3.0"
}
},
"eslint-plugin-promise": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz",
"integrity": "sha1-ePu2/+BHIBYnVp6FpsU3OvKmj8o=",
"dev": true
},
"eslint-plugin-react": {
"version": "6.10.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz",
"integrity": "sha1-xUNb6wZ3ThLH2y9qut3L+QDNP3g=",
"dev": true,
"requires": {
"array.prototype.find": "2.0.4",
"doctrine": "1.5.0",
"has": "1.0.1",
"jsx-ast-utils": "1.4.1",
"object.assign": "4.0.4"
},
"dependencies": {
"doctrine": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
"dev": true,
"requires": {
"esutils": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
"isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz"
}
}
}
},
"eslint-plugin-standard": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz",
"integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=",
"dev": true
},
"espree": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/espree/-/espree-3.4.3.tgz",
"integrity": "sha1-KRC1zNSc6JPC//+qtP2LOjG4I3Q=",
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/espree/-/espree-3.5.0.tgz",
"integrity": "sha1-mDWGJb3QVYYeon4oZ+pyn69GPY0=",
"dev": true,
"requires": {
"acorn": "5.1.1",
@ -1914,7 +2006,7 @@
"dev": true,
"requires": {
"d": "1.0.0",
"es5-ext": "0.10.24"
"es5-ext": "0.10.29"
}
},
"events": {
@ -2153,7 +2245,7 @@
"integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=",
"dev": true,
"requires": {
"circular-json": "0.3.1",
"circular-json": "0.3.3",
"del": "2.2.2",
"graceful-fs": "4.1.11",
"write": "0.2.1"
@ -2435,6 +2527,12 @@
"parse-passwd": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz"
}
},
"hosted-git-info": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz",
"integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==",
"dev": true
},
"htmlescape": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz",
@ -2573,7 +2671,7 @@
"ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"cli-cursor": "1.0.2",
"cli-width": "2.1.0",
"cli-width": "2.2.0",
"figures": "1.7.0",
"lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
"readline2": "1.0.1",
@ -2661,6 +2759,15 @@
"version": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz",
"integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw="
},
"is-builtin-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
"dev": true,
"requires": {
"builtin-modules": "1.1.1"
}
},
"is-callable": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz",
@ -2732,9 +2839,9 @@
}
},
"is-my-json-valid": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz",
"integrity": "sha1-8Hndm/2uZe4gOKrorLyGqxCeNpM=",
"version": "2.16.1",
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz",
"integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==",
"dev": true,
"requires": {
"generate-function": "2.0.0",
@ -2861,9 +2968,9 @@
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls="
},
"js-yaml": {
"version": "3.9.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.0.tgz",
"integrity": "sha512-0LoUNELX4S+iofCT8f4uEHIiRBR+c2AINyC8qRWfC6QNruLtxVZRJaPcu/xwMgFIgDxF25tGHaDjvxzJCNE9yw==",
"version": "3.9.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.1.tgz",
"integrity": "sha512-CbcG379L1e+mWBnLvHWWeLs8GyV/EMw862uLI3c+GxVyDHWZcjZinwuBd3iW2pgxgIlksW/1vNJa4to+RvDOww==",
"dev": true,
"requires": {
"argparse": "1.0.9",
@ -3432,6 +3539,18 @@
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-4.0.1.tgz",
"integrity": "sha1-uVhksH+s7oKH6CMu/9bx1W7HWrI="
},
"normalize-package-data": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
"integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
"dev": true,
"requires": {
"hosted-git-info": "2.5.0",
"is-builtin-module": "1.0.0",
"semver": "5.3.0",
"validate-npm-package-license": "3.0.1"
}
},
"normalize-path": {
"version": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
"integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
@ -3682,6 +3801,15 @@
"version": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"path-type": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz",
"integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
"dev": true,
"requires": {
"pify": "2.3.0"
}
},
"pbkdf2": {
"version": "3.0.13",
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.13.tgz",
@ -4103,6 +4231,38 @@
}
}
},
"read-pkg": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz",
"integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=",
"dev": true,
"requires": {
"load-json-file": "2.0.0",
"normalize-package-data": "2.4.0",
"path-type": "2.0.0"
}
},
"read-pkg-up": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz",
"integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=",
"dev": true,
"requires": {
"find-up": "2.1.0",
"read-pkg": "2.0.0"
},
"dependencies": {
"find-up": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
"dev": true,
"requires": {
"locate-path": "2.0.0"
}
}
}
},
"readable-stream": {
"version": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
@ -4526,6 +4686,27 @@
"integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=",
"dev": true
},
"spdx-correct": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz",
"integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=",
"dev": true,
"requires": {
"spdx-license-ids": "1.2.2"
}
},
"spdx-expression-parse": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz",
"integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=",
"dev": true
},
"spdx-license-ids": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz",
"integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=",
"dev": true
},
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@ -4559,16 +4740,16 @@
}
},
"standard": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/standard/-/standard-10.0.2.tgz",
"integrity": "sha1-l0wcU8yGWwdaS1dueEQeFpXar3s=",
"version": "10.0.3",
"resolved": "https://registry.npmjs.org/standard/-/standard-10.0.3.tgz",
"integrity": "sha512-JURZ+85ExKLQULckDFijdX5WHzN6RC7fgiZNSV4jFQVo+3tPoQGHyBrGekye/yf0aOfb4210EM5qPNlc2cRh4w==",
"dev": true,
"requires": {
"eslint": "3.19.0",
"eslint-config-standard": "10.2.1",
"eslint-config-standard-jsx": "4.0.1",
"eslint-config-standard-jsx": "4.0.2",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-node": "4.2.2",
"eslint-plugin-node": "4.2.3",
"eslint-plugin-promise": "3.5.0",
"eslint-plugin-react": "6.10.3",
"eslint-plugin-standard": "3.0.1",
@ -4585,17 +4766,16 @@
"isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz"
}
},
"eslint-config-standard": {
"version": "10.2.1",
"resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz",
"integrity": "sha1-wGHk0GbzedwXzVYsZOgZtN1FRZE=",
"dev": true
},
"eslint-config-standard-jsx": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-4.0.1.tgz",
"integrity": "sha1-zU5GPQJo4tnnB/YfQvc/WzMzxkI=",
"dev": true
"eslint-import-resolver-node": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz",
"integrity": "sha1-Wt2BBujJKNssuiMrzZ76hG49oWw=",
"dev": true,
"requires": {
"debug": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
"object-assign": "4.1.1",
"resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz"
}
},
"eslint-plugin-import": {
"version": "2.2.0",
@ -4614,38 +4794,6 @@
"minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"pkg-up": "1.0.0"
}
},
"eslint-plugin-node": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-4.2.2.tgz",
"integrity": "sha1-gpWcqa7Xn8vSi7GxiNBcrAT7M2M=",
"dev": true,
"requires": {
"ignore": "3.3.3",
"minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"object-assign": "4.1.1",
"resolve": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz",
"semver": "5.3.0"
}
},
"eslint-plugin-react": {
"version": "6.10.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz",
"integrity": "sha1-xUNb6wZ3ThLH2y9qut3L+QDNP3g=",
"dev": true,
"requires": {
"array.prototype.find": "2.0.4",
"doctrine": "1.5.0",
"has": "1.0.1",
"jsx-ast-utils": "1.4.1",
"object.assign": "4.0.4"
}
},
"eslint-plugin-standard": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz",
"integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=",
"dev": true
}
}
},
@ -4944,7 +5092,7 @@
"chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
"slice-ansi": "0.0.4",
"string-width": "2.1.0"
"string-width": "2.1.1"
},
"dependencies": {
"ajv": {
@ -4957,12 +5105,6 @@
"json-stable-stringify": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz"
}
},
"ajv-keywords": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz",
"integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=",
"dev": true
},
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
@ -4976,9 +5118,9 @@
"dev": true
},
"string-width": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.0.tgz",
"integrity": "sha1-AwZkVh/BRslCPsfZeP4kV0N/5tA=",
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
"dev": true,
"requires": {
"is-fullwidth-code-point": "2.0.0",
@ -5245,6 +5387,16 @@
"user-home": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz"
}
},
"validate-npm-package-license": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz",
"integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=",
"dev": true,
"requires": {
"spdx-correct": "1.0.2",
"spdx-expression-parse": "1.0.4"
}
},
"vary": {
"version": "https://registry.npmjs.org/vary/-/vary-1.1.1.tgz",
"integrity": "sha1-Z1Neu2lMHVIldFeYRmUyP1h+jTc="

View File

@ -55,15 +55,17 @@
"devDependencies": {
"browserify": "^14.4.0",
"concurrently": "^3.5.0",
"eslint-plugin-import": "^2.7.0",
"jquery": "^3.2.1",
"standard": "^10.0.2",
"standard": "^10.0.3",
"uglify-js": "^1.3.5",
"watchify": "^3.9.0"
},
"standard": {
"env": {
"browser": true,
"node": true
"node": true,
"jquery": true
}
}
}

View File

@ -2,7 +2,7 @@ import url from 'url'
import qs from 'querystring'
function HTTP_GET (link, headers = {}, lback) {
if(lback && lback >= 4) throw new Error('infinite loop!') // Prevent infinite loop requests
if (lback && lback >= 4) throw new Error('infinite loop!') // Prevent infinite loop requests
let parsed = url.parse(link)
let opts = {
host: parsed.hostname,
@ -15,7 +15,7 @@ function HTTP_GET (link, headers = {}, lback) {
}
}
if(headers) {
if (headers) {
opts.headers = Object.assign(opts.headers, headers)
}
@ -25,7 +25,7 @@ function HTTP_GET (link, headers = {}, lback) {
return new Promise((resolve, reject) => {
let req = httpModule.get(opts, (res) => {
if (res.statusCode === 302 || res.statusCode === 301) {
if(!lback) {
if (!lback) {
lback = 1
} else {
lback += 1
@ -61,7 +61,7 @@ function HTTP_GET (link, headers = {}, lback) {
function HTTP_POST (link, headers = {}, data) {
let parsed = url.parse(link)
let post_data = qs.stringify(data)
let postData = qs.stringify(data)
let opts = {
host: parsed.host,
@ -70,7 +70,7 @@ function HTTP_POST (link, headers = {}, data) {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(post_data),
'Content-Length': Buffer.byteLength(postData),
'User-Agent': 'Squeebot/Commons-2.0.0'
}
}
@ -80,7 +80,7 @@ function HTTP_POST (link, headers = {}, data) {
}
if (opts.headers['Content-Type'] === 'application/json') {
post_data = JSON.stringify(data)
postData = JSON.stringify(data)
}
return new Promise((resolve, reject) => {
@ -100,7 +100,7 @@ function HTTP_POST (link, headers = {}, data) {
reject(new Error(e))
})
req.write(post_data)
req.write(postData)
req.end()
})
}

View File

@ -1,6 +1,5 @@
import {EmailTemplate} from 'email-templates'
import path from 'path'
import bluebird from 'bluebird'
import nodemailer from 'nodemailer'
import config from '../../scripts/load-config'

View File

@ -1,5 +1,4 @@
import config from '../../scripts/load-config'
import database from '../../scripts/load-database'
import http from '../../scripts/http'
import models from './models'
import UAPI from './index'
@ -84,7 +83,7 @@ const API = {
// Determine profile picture
let profilepic = ''
if (fbdata.picture) {
if (fbdata.picture.is_silhouette == false && fbdata.picture.url) {
if (fbdata.picture.is_silhouette === false && fbdata.picture.url) {
// TODO: Download the profile image and save it locally
profilepic = fbdata.picture.url
}
@ -141,7 +140,7 @@ const API = {
getRequestToken: async function () {
if (!twitterApp) API.Twitter.oauthApp()
let tokens
try {
tokens = await twitterApp.getOAuthRequestToken()
} catch (e) {
@ -149,7 +148,7 @@ const API = {
return {error: 'No tokens returned'}
}
if (tokens[2].oauth_callback_confirmed !== "true") return {error: 'No tokens returned.'}
if (tokens[2].oauth_callback_confirmed !== 'true') return {error: 'No tokens returned.'}
return {error: null, token: tokens[0], token_secret: tokens[1]}
},
@ -172,8 +171,8 @@ const API = {
if (!twitterApp) API.Twitter.oauthApp()
let twdata
try {
let resp = await twitterApp.get('https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true', accessTokens.access_token,
accessTokens.access_token_secret)
let resp = await twitterApp.get('https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true',
accessTokens.access_token, accessTokens.access_token_secret)
twdata = JSON.parse(resp[0])
} catch (e) {
console.error(e)
@ -236,7 +235,7 @@ const API = {
}
},
Discord: {
oauth2App: function() {
oauth2App: function () {
if (discordApp) return
discordApp = new oauth.PromiseOAuth2(
config.discord.api,

View File

@ -1,7 +1,6 @@
import path from 'path'
import cprog from 'child_process'
import config from '../../scripts/load-config'
import database from '../../scripts/load-database'
import models from './models'
import crypto from 'crypto'
import notp from 'notp'
@ -78,7 +77,7 @@ const API = {
},
ensureObject: async function (user, fieldsPresent = ['id']) {
if (typeof user !== 'object' || !keysAvailable(user, fieldsPresent)) {
return await API.User.get(user)
return API.User.get(user)
}
if (user.id) {

View File

@ -1,7 +1,5 @@
import API from './index'
import Models from './models'
import config from '../../scripts/load-config'
import database from '../../scripts/load-database'
const perPage = 8
@ -9,7 +7,7 @@ function slugify (title) {
return title.toLowerCase().replace(/\W/g, '-').substring(0, 16)
}
//** ppp - Posts Per Page; dcount - Post Count; page - number of current page
/* ppp - Posts Per Page; dcount - Post Count; page - number of current page */
function Pagination (ppp, dcount, page) {
if (!ppp) ppp = 5
if (!dcount) return null
@ -18,7 +16,7 @@ function Pagination (ppp, dcount, page) {
if (page > pageCount) page = pageCount
let offset = (page - 1) * ppp
return {
page: page,
perPage: ppp,
@ -98,9 +96,7 @@ const News = {
if (!article.length) return {}
article = article[0]
let poster = await API.User.get(article.user_id)
return await cleanArticle(article)
return cleanArticle(article)
}
}

View File

@ -9,7 +9,7 @@ module.exports = async (req, res, client, scope, user, redirectUri, createAllowF
}
if (createAllowFuture) {
if (!req.body || (typeof req.body['decision']) === undefined) {
if (!req.body || (typeof req.body['decision']) === 'undefined') {
throw new error.InvalidRequest('No decision parameter passed')
} else if (req.body['decision'] === '0') {
throw new error.AccessDenied('User denied access to the resource')

View File

@ -9,7 +9,7 @@ module.exports = async (req, res, client, scope, user, redirectUri, createAllowF
}
if (createAllowFuture) {
if (!req.body || (typeof req.body['decision']) === undefined) {
if (!req.body || (typeof req.body['decision']) === 'undefined') {
throw new error.InvalidRequest('No decision parameter passed')
} else if (req.body['decision'] === '0') {
throw new error.AccessDenied('User denied access to the resource')

View File

@ -24,7 +24,7 @@ module.exports = wrap(async function (req, res) {
return response.error(req, res, new error.InvalidRequest('Unsupported authorization method:', pieces[0]))
}
pieces = new Buffer(pieces[1], 'base64').toString('ascii').split(':', 2)
pieces = Buffer.from(pieces[1], 'base64').toString('ascii').split(':', 2)
if (!pieces || pieces.length !== 2) {
return response.error(req, res, new error.InvalidRequest('Authorization header has corrupted data'))
}

View File

@ -26,7 +26,7 @@ module.exports = wrap(async (req, res) => {
return response.error(req, res, new error.InvalidRequest('Unsupported authorization method:', pieces[0]))
}
pieces = new Buffer(pieces[1], 'base64').toString('ascii').split(':', 2)
pieces = Buffer.from(pieces[1], 'base64').toString('ascii').split(':', 2)
if (!pieces || pieces.length !== 2) {
return response.error(req, res, new error.InvalidRequest('Authorization header has corrupted data'))
}
@ -44,7 +44,7 @@ module.exports = wrap(async (req, res) => {
console.debug('Parameter grant_type is', grantType)
let client = await req.oauth2.model.client.fetchById(clientId)
if (!client) {
return response.error(req, res, new error.InvalidClient('Client not found'))
}

View File

@ -25,7 +25,7 @@ module.exports = async (oauth2, client, pRefreshToken, scope) => {
}
if (oauth2.model.refreshToken.getClientId(refreshToken) !== oauth2.model.client.getId(client)) {
console.warn('Client "' + oauth2.model.client.getId(client) + '" tried to fetch a refresh token which belongs to client"' +
console.warn('Client "' + oauth2.model.client.getId(client) + '" tried to fetch a refresh token which belongs to client"' +
oauth2.model.refreshToken.getClientId(refreshToken) + '"')
throw new error.InvalidGrant('Refresh token not found')
}
@ -59,7 +59,7 @@ module.exports = async (oauth2, client, pRefreshToken, scope) => {
if (!accessToken) {
try {
resObj.access_token = await oauth2.model.accessToken.create(oauth2.model.user.getId(user),
resObj.access_token = await oauth2.model.accessToken.create(oauth2.model.user.getId(user),
oauth2.model.client.getId(client), oauth2.model.refreshToken.getScope(refreshToken), oauth2.model.accessToken.ttl)
} catch (err) {
throw new error.ServerError('Failed to call accessToken.create function')

View File

@ -1,8 +1,6 @@
import config from '../../../scripts/load-config'
import database from '../../../scripts/load-database'
import Models from '../models'
import Users from '../index'
import crypto from 'crypto'
const OAuthDB = {
@ -62,7 +60,7 @@ const OAuthDB = {
},
fetchById: async (id) => {
let client = await Models.OAuth2Client.query().where('id', id)
if (!client.length) return null
return client[0]
@ -91,7 +89,7 @@ const OAuthDB = {
}
scope = scope.trim()
if (scope.indexOf(',') != -1) {
if (scope.indexOf(',') !== -1) {
scope = scope.split(',')
} else {
scope = scope.split(' ')
@ -141,7 +139,7 @@ const OAuthDB = {
code = await Models.OAuth2Code.query().where('code', code)
if (!code.length) return null
return code[0]
},
removeByCode: async (code) => {
@ -149,7 +147,7 @@ const OAuthDB = {
code = code.code
}
return await Models.OAuth2Code.query().delete().where('code', code)
return Models.OAuth2Code.query().delete().where('code', code)
},
getUserId: (code) => {
return code.user_id
@ -182,15 +180,15 @@ const OAuthDB = {
token = await Models.OAuth2RefreshToken.query().where('token', token)
if (!token.length) return null
return token[0]
},
removeByUserIdClientId: async (userId, clientId) => {
return await Models.OAuth2RefreshToken.query().delete().where('user_id', userId)
return Models.OAuth2RefreshToken.query().delete().where('user_id', userId)
.andWhere('client_id', clientId)
},
removeByRefreshToken: async (token) => {
return await Models.OAuth2RefreshToken.query().delete().where('token', token)
return Models.OAuth2RefreshToken.query().delete().where('token', token)
},
getUserId: (refreshToken) => {
return refreshToken.user_id

View File

@ -1,9 +1,7 @@
import express from 'express'
import parseurl from 'parseurl'
import RateLimit from 'express-rate-limit'
import config from '../../scripts/load-config'
import wrap from '../../scripts/asyncRoute'
import API from '../api'
import APIExtern from '../api/external'
import News from '../api/news'
@ -63,8 +61,8 @@ function createSession (req, user) {
}
// Either give JSON or make a redirect
function JsonData (req, res, error, redirect='/') {
if (req.headers['content-type'] == 'application/json') {
function JsonData (req, res, error, redirect = '/') {
if (req.headers['content-type'] === 'application/json') {
return res.jsonp({error: error, redirect: redirect})
}
@ -155,7 +153,7 @@ router.get('/external/twitter/callback', wrap(async (req, res) => {
*/
router.get('/external/discord/login', wrap(async (req, res) => {
if (!config.discord || !config.discord.api) return res.redirect('/')
let infos = APIExtern.Discord.getAuthorizeURL()
req.session.discord_auth = {

View File

@ -8,7 +8,6 @@ import wrap from '../../scripts/asyncRoute'
import http from '../../scripts/http'
import API from '../api'
import News from '../api/news'
import email from '../api/emailer'
import apiRouter from './api'
import oauthRouter from './oauth2'
@ -102,9 +101,8 @@ router.get('/user/two-factor', wrap(async (req, res) => {
let newToken = await API.User.Login.totpAquire(req.session.user)
if (!newToken) return res.redirect('/')
res.locals.uri = newToken
res.render('totp')
res.render('totp', { uri: newToken })
}))
router.get('/user/two-factor/disable', wrap(async (req, res) => {
@ -133,7 +131,7 @@ function formError (req, res, error, redirect) {
delete req.body.password_repeat
}
}
req.flash('formkeep', req.body || {})
req.flash('message', {error: true, text: error})
res.redirect(redirect || parseurl(req).path)
@ -279,8 +277,8 @@ router.post('/register', accountLimiter, wrap(async (req, res) => {
}
// 2nd Check: Display Name
let display_name = req.body.display_name
if (!display_name || !display_name.match(/^([^\\`]{3,32})$/i)) {
let displayName = req.body.display_name
if (!displayName || !displayName.match(/^([^\\`]{3,32})$/i)) {
return formError(req, res, 'Invalid display name!')
}
@ -305,7 +303,7 @@ router.post('/register', accountLimiter, wrap(async (req, res) => {
// 6th Check: reCAPTCHA (if configuration contains key)
if (config.security.recaptcha && config.security.recaptcha.site_key) {
if (!req.body['g-recaptcha-response']) return formError(req, res, 'Please complete the reCAPTCHA!')
try {
let data = await http.POST('https://www.google.com/recaptcha/api/siteverify', {}, {
secret: config.security.recaptcha.secret_key,
@ -328,7 +326,7 @@ router.post('/register', accountLimiter, wrap(async (req, res) => {
// Attempt to create the user
let newUser = await API.User.Register.newAccount({
username: username,
display_name: display_name,
display_name: displayName,
password: hash,
email: email,
ip_address: req.realIP
@ -381,7 +379,7 @@ router.get('/news/', wrap(async (req, res) => {
}
let news = await News.listNews(page)
res.render('news', {news: news})
}))
@ -412,11 +410,6 @@ router.get('/activate/:token', wrap(async (req, res) => {
router.use('/api', apiRouter)
/*router.get('/test', (req, res, next) => {
email.pushMail('test', req.session.user.email, req.session.user).catch((e) => {next(e)})
res.jsonp({})
})*/
router.use((err, req, res, next) => {
console.error(err)
next()

View File

@ -5,12 +5,9 @@ import connectSession from 'connect-redis'
import path from 'path'
import crypto from 'crypto'
import fs from 'fs'
import routes from './routes'
import flash from '../scripts/flash'
import config from '../scripts/load-config'
import database from '../scripts/load-database'
import email from './api/emailer'
let app = express()

View File

@ -1,15 +1,29 @@
window.$ = require('jquery')
$(document).ready(function () {
function pwcheck (e) {
var pw = $('#password').val()
var pwa = $('#password_repeat').val()
if (pwa !== pw) {
$('#password_repeat').addClass('invalid')
$('#repeatcheck').show()
$('#repeatcheck').html('<span class="error">The passwords do not match.</span>')
} else {
$('#password_repeat').removeClass('invalid')
$('#repeatcheck').hide()
$('#repeatcheck').html('')
}
}
if (window.location.hash) {
var locha = window.location.hash
var locha = window.location.hash
if ($(locha).length) {
$(window).scrollTop($(locha).offset().top - $('.navigator').innerHeight() * 2)
}
}
$(window).on('scroll', function() {
if($(window).scrollTop() >= $('.banner').innerHeight()) {
$(window).on('scroll', function () {
if ($(window).scrollTop() >= $('.banner').innerHeight()) {
$('.anchor').css('height', $('.navigator').innerHeight() + 'px')
$('#navlogo').removeClass('hidden')
$('.navigator').addClass('fix')
@ -20,7 +34,7 @@ $(document).ready(function () {
}
})
if($(window).scrollTop() >= $('.banner').innerHeight()) {
if ($(window).scrollTop() >= $('.banner').innerHeight()) {
$('#navlogo').removeClass('hidden')
$('.navigator').addClass('fix')
$('.anchor').css('height', $('.navigator').innerHeight() + 'px')
@ -32,13 +46,13 @@ $(document).ready(function () {
var dest = 0
if ($(this.hash).offset().top > $(document).height() - $(window).height()) {
dest = $(document).height() - $(window).height()
dest = $(document).height() - $(window).height()
} else {
dest = $(this.hash).offset().top
dest = $(this.hash).offset().top
}
$('html,body').animate({
scrollTop: dest - $('.navigator').innerHeight()
scrollTop: dest - $('.navigator').innerHeight()
}, 1000, 'swing')
})
@ -47,27 +61,13 @@ $(document).ready(function () {
$('.flexview').toggleClass('extended')
})
$('body').click(function(e) {
$('body').click(function (e) {
if (!$(e.target).is('#mobile') && !$(e.target).is('#mobile i') && $('.flexview').hasClass('extended')) {
$('.flexview').removeClass('extended')
}
})
if ($('#repeatcheck').length) {
function pwcheck (e) {
var pw = $('#password').val()
var pwa = $('#password_repeat').val()
if (pwa !== pw) {
$('#password_repeat').addClass('invalid')
$('#repeatcheck').show()
$('#repeatcheck').html('<span class="error">The passwords do not match.</span>')
} else {
$('#password_repeat').removeClass('invalid')
$('#repeatcheck').hide()
$('#repeatcheck').html('')
}
}
$('#password_repeat').on('keyup', pwcheck)
$('#password').on('keyup', function (e) {
if ($('#password_repeat').val()) {
@ -101,7 +101,8 @@ $(document).ready(function () {
}
window.checkLoginState = function () {
FB.getLoginStatus(function(response) {
var FB = window.FB
FB.getLoginStatus(function (response) {
$.ajax({
type: 'post',
url: '/api/external/facebook/callback',
@ -115,12 +116,13 @@ $(document).ready(function () {
}
if (data.redirect) {
return window.location.href = data.redirect
window.location.href = data.redirect
return
}
window.location.reload()
}
}).fail(function() {
}).fail(function () {
$('.message').addClass('error')
$('.message span').text('An error occured.')
})