From 5a7fd489930d1ccf1e1d7c632f01779d18353409 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 8 Jul 2019 22:34:22 +0800 Subject: [PATCH] chore(deps): update dependency eslint to v6 --- .eslintrc | 4 +++- lib/routes/weibo/utils.js | 25 ++++++++++++------------- package.json | 2 +- yarn.lock | 38 ++++++++++++++++++++++++-------------- 4 files changed, 40 insertions(+), 29 deletions(-) diff --git a/.eslintrc b/.eslintrc index 53a25376bebc8a..a85401527e86eb 100644 --- a/.eslintrc +++ b/.eslintrc @@ -50,6 +50,8 @@ "no-trailing-spaces": 1, "no-control-regex": 0, "prettier/prettier": 0, - "no-await-in-loop": 1 + "no-await-in-loop": 1, + "require-atomic-updates": 0, + "no-prototype-builtins": 0 } } diff --git a/lib/routes/weibo/utils.js b/lib/routes/weibo/utils.js index 080a58c76a4f54..cac7d3d7e7065f 100644 --- a/lib/routes/weibo/utils.js +++ b/lib/routes/weibo/utils.js @@ -37,19 +37,18 @@ const weiboUtils = { } return temp; }, - getShowData: (uid, bid) => - new Promise(async function(resolve) { - const link = `https://m.weibo.cn/statuses/show?id=${bid}`; - const itemResponse = await got.get(link, { - headers: { - Referer: `https://m.weibo.cn/u/${uid}`, - 'MWeibo-Pwa': 1, - 'X-Requested-With': 'XMLHttpRequest', - 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', - }, - }); - resolve(itemResponse.data.data); - }), + getShowData: async (uid, bid) => { + const link = `https://m.weibo.cn/statuses/show?id=${bid}`; + const itemResponse = await got.get(link, { + headers: { + Referer: `https://m.weibo.cn/u/${uid}`, + 'MWeibo-Pwa': 1, + 'X-Requested-With': 'XMLHttpRequest', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', + }, + }); + return itemResponse.data.data; + }, formatVideo: (itemDesc, status) => { const pageInfo = status.page_info; if (pageInfo && pageInfo.type === 'video') { diff --git a/package.json b/package.json index e5a16fc3145f64..686ef22ddcb8d8 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@vuepress/plugin-back-to-top": "1.0.2", "@vuepress/plugin-google-analytics": "1.0.2", "@vuepress/plugin-pwa": "1.0.2", - "eslint": "5.16.0", + "eslint": "6.0.1", "eslint-config-prettier": "6.0.0", "eslint-plugin-prettier": "3.1.0", "jest": "24.8.0", diff --git a/yarn.lock b/yarn.lock index 7029365d6d4b2d..0747459a9b704b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1455,6 +1455,16 @@ ajv@^6.1.0, ajv@^6.5.5, ajv@^6.9.1: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^6.10.0: + version "6.10.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.1.tgz#ebf8d3af22552df9dd049bfbe50cc2390e823593" + integrity sha512-w1YQaVGNC6t2UCPjEawK/vo/dG8OOrVtUmhBT1uJJYxbl5kU2Tj3v6LGqBcsysN1yhuCStJCCA3GqdvKY8sqXQ== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + algoliasearch@^3.24.5: version "3.33.0" resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-3.33.0.tgz#83b541124ebb0db54643009d4e660866b3177cdf" @@ -3670,13 +3680,13 @@ eslint-visitor-keys@^1.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== -eslint@5.16.0: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== +eslint@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.0.1.tgz#4a32181d72cb999d6f54151df7d337131f81cda7" + integrity sha512-DyQRaMmORQ+JsWShYsSg4OPTjY56u1nCjAmICrE8vLWqyLKxhFXOthwMj1SA8xwfrv0CofLNVnqbfyhwCkaO0w== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.9.1" + ajv "^6.10.0" chalk "^2.1.0" cross-spawn "^6.0.5" debug "^4.0.1" @@ -3684,18 +3694,19 @@ eslint@5.16.0: eslint-scope "^4.0.3" eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" - espree "^5.0.1" + espree "^6.0.0" esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" - glob "^7.1.2" + glob-parent "^3.1.0" globals "^11.7.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" inquirer "^6.2.2" - js-yaml "^3.13.0" + is-glob "^4.0.0" + js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" lodash "^4.17.11" @@ -3703,7 +3714,6 @@ eslint@5.16.0: mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" - path-is-inside "^1.0.2" progress "^2.0.0" regexpp "^2.0.1" semver "^5.5.1" @@ -3712,10 +3722,10 @@ eslint@5.16.0: table "^5.2.3" text-table "^0.2.0" -espree@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" - integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== +espree@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.0.0.tgz#716fc1f5a245ef5b9a7fdb1d7b0d3f02322e75f6" + integrity sha512-lJvCS6YbCn3ImT3yKkPe0+tJ+mH6ljhGNjHQH9mRtiO6gjhVAOhVXW1yjnwqGwTkK3bGbye+hb00nFNmu0l/1Q== dependencies: acorn "^6.0.7" acorn-jsx "^5.0.0" @@ -5888,7 +5898,7 @@ js-tokens@^3.0.1: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@^3.11.0, js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.9.0: +js-yaml@^3.11.0, js-yaml@^3.13.1, js-yaml@^3.9.0: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==