From b520d4e448cc84da773615d058ae9cc0831dec1b Mon Sep 17 00:00:00 2001 From: Soitora Date: Thu, 21 May 2020 04:47:01 +0200 Subject: [PATCH] Project Linting (#209) * More setup for ESLint * Initial linting * Fix: "Unexpected use of 'location': no-restricted-globals" * Fix: "Prop 'sidebarItems' should define at least its type" * Fix: "import/no-unresolved" * Fix: "import/no-extraneous-dependencies" * Fix: "Unexpected require() 'global-require'" * Fix: "vue/require-prop-types" * Line disable: "radix" * Line disable: "no-param-reassign" * Line disable: "no-shadow" This should usually be an actual problem but I don't think so in this case as the next prompt is basically just a one-action warning. * Add markdown linting support * Replace single quotes with double * Fix indentation for all files * Fix second level quotation marks * Change accordingly I'd still rather keep 4-tab for MD when applicable though, the alternative is a non-standard 3-space indent, which makes three different indentations to keep track of. --- .eslintignore | 1 + .eslintrc.json | 20 +- .github/workflows/push.yml | 4 +- .stylintrc | 88 +- README.md | 22 +- package-lock.json | 257 +- package.json | 6 +- src/.vuepress/components/Carousel.vue | 12 +- src/.vuepress/components/CarouselItem.vue | 6 +- src/.vuepress/components/DownloadButtons.vue | 63 +- src/.vuepress/components/ExtensionList.vue | 18 +- src/.vuepress/components/ForkButtons.vue | 54 +- src/.vuepress/components/ForkPage.vue | 20 +- src/.vuepress/components/Help.vue | 406 +- src/.vuepress/components/MaterialIcon.vue | 15 +- src/.vuepress/components/Navigation.vue | 22 +- src/.vuepress/components/VersionTag.vue | 6 +- src/.vuepress/config.js | 73 +- src/.vuepress/config/{nav.js => navBar.js} | 0 src/.vuepress/config/plugins.js | 34 +- src/.vuepress/config/sideBar.js | 148 + src/.vuepress/config/sidebar/contribution.js | 27 - src/.vuepress/config/sidebar/extensions.js | 23 - src/.vuepress/config/sidebar/faq.js | 23 - src/.vuepress/config/sidebar/forks.js | 23 - src/.vuepress/config/sidebar/guides.js | 52 - src/.vuepress/enhanceApp.js | 16 +- src/.vuepress/public/manifest.json | 42 +- src/.vuepress/styles/animate.css | 6164 ++++++++--------- src/.vuepress/styles/fonts.styl | 6 +- src/.vuepress/styles/index.styl | 2 +- src/.vuepress/styles/palette.styl | 4 +- src/.vuepress/styles/sweetalert2.css | 1371 ++++ .../theme/components/AlgoliaSearchBox.vue | 335 +- src/.vuepress/theme/components/Home.vue | 1 + src/.vuepress/theme/components/Navbar.vue | 251 +- src/.vuepress/theme/index.js | 2 +- src/README.md | 18 +- src/help/contribution.md | 4 +- src/help/guides/settings/reader.md | 56 +- src/help/guides/source-migration.md | 3 +- src/help/guides/source-problems.md | 4 +- 42 files changed, 5704 insertions(+), 3998 deletions(-) create mode 100644 .eslintignore rename src/.vuepress/config/{nav.js => navBar.js} (100%) create mode 100644 src/.vuepress/config/sideBar.js delete mode 100644 src/.vuepress/config/sidebar/contribution.js delete mode 100644 src/.vuepress/config/sidebar/extensions.js delete mode 100644 src/.vuepress/config/sidebar/faq.js delete mode 100644 src/.vuepress/config/sidebar/forks.js delete mode 100644 src/.vuepress/config/sidebar/guides.js create mode 100644 src/.vuepress/styles/sweetalert2.css diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..a9179caf --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +!.vuepress \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json index 079351b9..b0d38a5b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,18 +5,28 @@ }, "extends": [ "plugin:vue/essential", - "vuepress", - "prettier" + "airbnb-base", + "prettier", + "vuepress" ], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, "parserOptions": { "ecmaVersion": 2018, "sourceType": "module" }, "plugins": [ "vue", - "prettier" + "prettier", + "markdown" ], "rules": { - "prettier/prettier": ["error"] + "prettier/prettier": "error", + "import/no-unresolved": [ + 2, + { "ignore": ["^@"] } + ] } -} +} \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5f64c873..96f85c9b 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -31,6 +31,6 @@ jobs: deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} publish_branch: gh-pages publish_dir: ./public - user_name: 'github-actions[bot]' - user_email: 'github-actions[bot]@users.noreply.github.com' + user_name: "github-actions[bot]" + user_email: "github-actions[bot]@users.noreply.github.com" commit_message: ${{ github.event.head_commit.message }} diff --git a/.stylintrc b/.stylintrc index f2cf8492..d98e6066 100644 --- a/.stylintrc +++ b/.stylintrc @@ -1,47 +1,47 @@ { - "blocks": false, - "brackets": "never", - "colons": "never", - "colors": "always", - "commaSpace": "always", - "commentSpace": "always", - "cssLiteral": "never", - "customProperties": [], - "depthLimit": false, - "duplicates": true, - "efficient": "always", - "exclude": [], - "extendPref": "@extends", - "globalDupe": true, - "groupOutputByFile": true, - "indentPref": false, - "leadingZero": "always", - "maxErrors": false, - "maxWarnings": false, - "mixed": true, - "mixins": [], - "namingConvention": false, - "namingConventionStrict": false, - "none": "always", - "noImportant": false, - "parenSpace": "never", - "placeholders": "always", - "prefixVarsWithDollar": "always", - "quotePref": false, - "reporterOptions": { - "columns": ["lineData", "severity", "description", "rule"], - "columnSplitter": " ", - "showHeaders": false, - "truncate": true - }, - "semicolons": "never", - "sortOrder": ["grouped", "alphabetical"], - "stackedProperties": "never", - "trailingWhitespace": "never", - "universal": false, - "valid": true, - "zeroUnits": "never", + "blocks": false, + "brackets": "never", + "colons": "never", + "colors": "always", + "commaSpace": "always", + "commentSpace": "always", + "cssLiteral": "never", + "customProperties": [], + "depthLimit": false, + "duplicates": true, + "efficient": "always", + "exclude": [], + "extendPref": "@extends", + "globalDupe": true, + "groupOutputByFile": true, + "indentPref": false, + "leadingZero": "always", + "maxErrors": false, + "maxWarnings": false, + "mixed": true, + "mixins": [], + "namingConvention": false, + "namingConventionStrict": false, + "none": "always", + "noImportant": false, + "parenSpace": "never", + "placeholders": "always", + "prefixVarsWithDollar": "always", + "quotePref": false, + "reporterOptions": { + "columns": ["lineData", "severity", "description", "rule"], + "columnSplitter": " ", + "showHeaders": false, + "truncate": true + }, + "semicolons": "never", + "sortOrder": ["grouped", "alphabetical"], + "stackedProperties": "never", + "trailingWhitespace": "never", + "universal": false, + "valid": true, + "zeroUnits": "never", "zIndexNormalize": false, - "stylusSupremacy.selectorSeparator": ",\n", - "stylusSupremacy.insertNewLineAroundBlocks": "root" + "stylusSupremacy.selectorSeparator": ",\n", + "stylusSupremacy.insertNewLineAroundBlocks": "root" } diff --git a/README.md b/README.md index 32629a54..731381a7 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ -

Tachiyomi Website

-

- - Discord - -

+
+

Tachiyomi Website

+

+ + Discord + +

+
## Contributing @@ -18,8 +20,8 @@ Pull requests are welcome. For major changes, please open an issue first to disc ## License - Copyright (C) 2018 The Tachiyomi Open Source Project + Copyright (C) 2018 The Tachiyomi Open Source Project - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/package-lock.json b/package-lock.json index 341a2fd6..9b5619db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2189,6 +2189,12 @@ "object.assign": "^4.1.0" } }, + "bail": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", + "integrity": "sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==", + "dev": true + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -2873,6 +2879,24 @@ "supports-color": "^5.3.0" } }, + "character-entities": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", + "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", + "dev": true + }, + "character-entities-legacy": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", + "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", + "dev": true + }, + "character-reference-invalid": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", + "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", + "dev": true + }, "chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", @@ -3099,6 +3123,12 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "collapse-white-space": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.6.tgz", + "integrity": "sha512-jEovNnrhMuqyCcjfEJA56v0Xq8SkIoPKDyaHahwo3POf4qcSXqMYuwNcOTzp74vTsR9Tn08z4MxWqAhcekogkQ==", + "dev": true + }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -4716,6 +4746,17 @@ } } }, + "eslint-plugin-markdown": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-1.0.2.tgz", + "integrity": "sha512-BfvXKsO0K+zvdarNc801jsE/NTLmig4oKhZ1U3aSUgTf2dB/US5+CrfGxMsCK2Ki1vS1R3HPok+uYpufFndhzw==", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "remark-parse": "^5.0.0", + "unified": "^6.1.2" + } + }, "eslint-plugin-node": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-10.0.0.tgz", @@ -6490,6 +6531,22 @@ } } }, + "is-alphabetical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", + "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", + "dev": true + }, + "is-alphanumerical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", + "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", + "dev": true, + "requires": { + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0" + } + }, "is-arguments": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", @@ -6580,6 +6637,12 @@ "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, + "is-decimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", + "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", + "dev": true + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -6638,6 +6701,12 @@ "is-extglob": "^2.1.1" } }, + "is-hexadecimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", + "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", + "dev": true + }, "is-installed-globally": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", @@ -6784,12 +6853,24 @@ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, + "is-whitespace-character": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz", + "integrity": "sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w==", + "dev": true + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, + "is-word-character": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.4.tgz", + "integrity": "sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA==", + "dev": true + }, "is-wsl": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", @@ -7111,8 +7192,7 @@ "lodash.orderby": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.orderby/-/lodash.orderby-4.6.0.tgz", - "integrity": "sha1-5pfwTOXXhSL1TZM4syuBozk+TrM=", - "dev": true + "integrity": "sha1-5pfwTOXXhSL1TZM4syuBozk+TrM=" }, "lodash.padstart": { "version": "4.6.1", @@ -7146,8 +7226,7 @@ "lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", - "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=", - "dev": true + "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=" }, "lodash.uniq": { "version": "4.5.0", @@ -7247,6 +7326,12 @@ "object-visit": "^1.0.0" } }, + "markdown-escapes": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz", + "integrity": "sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==", + "dev": true + }, "markdown-it": { "version": "8.4.2", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", @@ -8375,6 +8460,20 @@ "safe-buffer": "^5.1.1" } }, + "parse-entities": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.2.tgz", + "integrity": "sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg==", + "dev": true, + "requires": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + } + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -9627,6 +9726,29 @@ "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=", "dev": true }, + "remark-parse": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-5.0.0.tgz", + "integrity": "sha512-b3iXszZLH1TLoyUzrATcTQUZrwNl1rE70rVdSruJFlDaJ9z5aMkhrG43Pp68OgfHndL/ADz6V69Zow8cTQu+JA==", + "dev": true, + "requires": { + "collapse-white-space": "^1.0.2", + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-whitespace-character": "^1.0.0", + "is-word-character": "^1.0.0", + "markdown-escapes": "^1.0.0", + "parse-entities": "^1.1.0", + "repeat-string": "^1.5.4", + "state-toggle": "^1.0.0", + "trim": "0.0.1", + "trim-trailing-lines": "^1.0.0", + "unherit": "^1.0.4", + "unist-util-remove-position": "^1.0.0", + "vfile-location": "^2.0.0", + "xtend": "^4.0.1" + } + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -9712,6 +9834,12 @@ "is-finite": "^1.0.0" } }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -10665,6 +10793,12 @@ "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==", "dev": true }, + "state-toggle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.3.tgz", + "integrity": "sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==", + "dev": true + }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -11268,12 +11402,30 @@ "punycode": "^2.1.0" } }, + "trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=", + "dev": true + }, "trim-newlines": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", "dev": true }, + "trim-trailing-lines": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.3.tgz", + "integrity": "sha512-4ku0mmjXifQcTVfYDfR5lpgV7zVqPg6zV9rdZmwOPqq0+Zq19xDqEgagqVbc4pOOShbncuAOIs59R3+3gcF3ZA==", + "dev": true + }, + "trough": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", + "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==", + "dev": true + }, "true-case-path": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", @@ -11380,6 +11532,16 @@ } } }, + "unherit": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz", + "integrity": "sha512-Ft16BJcnapDKp0+J/rqFC3Rrk6Y/Ng4nzsC028k2jdDII/rdZ7Wd3pPT/6+vIIxRagwRc9K0IUX0Ra4fKvw+WQ==", + "dev": true, + "requires": { + "inherits": "^2.0.0", + "xtend": "^4.0.0" + } + }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", @@ -11408,6 +11570,20 @@ "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", "dev": true }, + "unified": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-6.2.0.tgz", + "integrity": "sha512-1k+KPhlVtqmG99RaTbAv/usu85fcSRu3wY8X+vnsEhIxNP5VbVIDiXnLqyKIG+UMdyTg0ZX9EI6k2AfjJkHPtA==", + "dev": true, + "requires": { + "bail": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^1.1.0", + "trough": "^1.0.0", + "vfile": "^2.0.0", + "x-is-string": "^0.1.0" + } + }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -11459,6 +11635,45 @@ "crypto-random-string": "^2.0.0" } }, + "unist-util-is": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", + "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", + "dev": true + }, + "unist-util-remove-position": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.4.tgz", + "integrity": "sha512-tLqd653ArxJIPnKII6LMZwH+mb5q+n/GtXQZo6S6csPRs5zB0u79Yw8ouR3wTw8wxvdJFhpP6Y7jorWdCgLO0A==", + "dev": true, + "requires": { + "unist-util-visit": "^1.1.0" + } + }, + "unist-util-stringify-position": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz", + "integrity": "sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ==", + "dev": true + }, + "unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "dev": true, + "requires": { + "unist-util-visit-parents": "^2.0.0" + } + }, + "unist-util-visit-parents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", + "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "dev": true, + "requires": { + "unist-util-is": "^3.0.0" + } + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -11776,6 +11991,33 @@ "extsprintf": "^1.2.0" } }, + "vfile": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-2.3.0.tgz", + "integrity": "sha512-ASt4mBUHcTpMKD/l5Q+WJXNtshlWxOogYyGYYrg4lt/vuRjC1EFQtlAofL5VmtVNIZJzWYFJjzGWZ0Gw8pzW1w==", + "dev": true, + "requires": { + "is-buffer": "^1.1.4", + "replace-ext": "1.0.0", + "unist-util-stringify-position": "^1.0.0", + "vfile-message": "^1.0.0" + } + }, + "vfile-location": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.6.tgz", + "integrity": "sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA==", + "dev": true + }, + "vfile-message": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-1.1.1.tgz", + "integrity": "sha512-1WmsopSGhWt5laNir+633LszXvZ+Z/lxveBf6yhGsqnQIhlhzooZae7zV6YVM1Sdkw68dtAW3ow0pOdPANugvA==", + "dev": true, + "requires": { + "unist-util-stringify-position": "^1.1.1" + } + }, "vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", @@ -11792,7 +12034,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/vue-agile/-/vue-agile-1.1.3.tgz", "integrity": "sha512-RnvKK6ZoXNAk2Q6h/ux+bhqYs4uflFew3xcsNfysQa+GVLKHfizAaeKHJndqGjSXA+qg+kJuYd4RDY/ry8RY4w==", - "dev": true, "requires": { "lodash.orderby": "^4.6.0", "lodash.throttle": "^4.1.1" @@ -12624,6 +12865,12 @@ "async-limiter": "~1.0.0" } }, + "x-is-string": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/x-is-string/-/x-is-string-0.1.0.tgz", + "integrity": "sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI=", + "dev": true + }, "xdg-basedir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", diff --git a/package.json b/package.json index ee497076..ba9be418 100644 --- a/package.json +++ b/package.json @@ -16,13 +16,16 @@ "@vuepress/plugin-google-analytics": "^1.5.0", "eslint": "^6.8.0", "eslint-config-airbnb": "^18.1.0", + "eslint-config-airbnb-base": "^14.1.0", "eslint-config-prettier": "^6.11.0", "eslint-config-vuepress": "^2.2.0", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-markdown": "^1.0.2", "eslint-plugin-prettier": "^3.1.3", + "eslint-plugin-vue": "^6.2.2", "node-sass": "^4.14.1", "prettier": "^2.0.5", "sass-loader": "^8.0.2", - "vue-agile": "^1.1.3", "vuepress": "^1.5.0", "vuepress-plugin-clean-urls": "^1.1.1", "vuepress-plugin-container": "^2.1.3" @@ -33,6 +36,7 @@ "lodash.groupby": "^4.6.0", "lodash.sortby": "^4.7.0", "material-design-icons": "^3.0.1", + "vue-agile": "^1.1.3", "vue-material-design-icons": "^4.6.0", "vue-sweetalert2": "^3.0.5", "vuepress-plugin-sitemap": "^2.3.1" diff --git a/src/.vuepress/components/Carousel.vue b/src/.vuepress/components/Carousel.vue index f6160fe9..47e4a2ee 100644 --- a/src/.vuepress/components/Carousel.vue +++ b/src/.vuepress/components/Carousel.vue @@ -16,18 +16,18 @@ export default { props: { name: { type: String, - default: "carousel" + default: "carousel", }, config: { type: Object, - default: function() { + default() { return { navButtons: true, - centerMode: true + centerMode: true, }; - } - } - } + }, + }, + }, }; diff --git a/src/.vuepress/components/CarouselItem.vue b/src/.vuepress/components/CarouselItem.vue index ccf6c4a2..123480d4 100644 --- a/src/.vuepress/components/CarouselItem.vue +++ b/src/.vuepress/components/CarouselItem.vue @@ -10,9 +10,9 @@ export default { props: { name: { type: String, - default: "carousel-cell" - } - } + default: "carousel-cell", + }, + }, }; diff --git a/src/.vuepress/components/DownloadButtons.vue b/src/.vuepress/components/DownloadButtons.vue index 5c99e3ef..2215f426 100644 --- a/src/.vuepress/components/DownloadButtons.vue +++ b/src/.vuepress/components/DownloadButtons.vue @@ -15,35 +15,34 @@ import axios from "axios"; const RELEASE_URL = "https://api.github.com/repos/inorichi/tachiyomi/releases/latest"; -const PREVIEW_URL = - "https://tachiyomi.kanade.eu/latest"; +const PREVIEW_URL = "https://tachiyomi.kanade.eu/latest"; export default { props: { downloadStableTag: { type: String, - required: true + required: true, }, downloadPreviewTag: { type: String, - required: true + required: true, }, downloadStableLabel: { type: String, - default: "Stable" + default: "Stable", }, downloadPreviewLabel: { type: String, - default: "Preview" + default: "Preview", }, downloadStableUrl: { type: String, - default: undefined + default: undefined, }, downloadPreviewUrl: { type: String, - default: undefined - } + default: undefined, + }, }, data() { @@ -56,7 +55,7 @@ export default { async mounted() { const { data } = await axios.get(RELEASE_URL); // Maybe eventually some release has more than the apk in assets. - const apkAsset = data.assets.find(a => a.name.includes(".apk")); + const apkAsset = data.assets.find((a) => a.name.includes(".apk")); // Set the values. this.$data.tagName = data.tag_name; this.$data.browserDownloadUrl = apkAsset.browser_download_url; @@ -66,7 +65,7 @@ export default { downloadStable() { this.$swal({ title: "Downloading", - text: this.downloadStableLabel + " version is being downloaded.", + text: `${this.downloadStableLabel} version is being downloaded.`, icon: "success", focusConfirm: false, focusCancel: false, @@ -74,24 +73,32 @@ export default { timerProgressBar: true, customClass: { confirmButton: "download-confirm-button", - container: "download-container" + container: "download-container", }, showClass: { - popup: "animated pulse faster" + popup: "animated pulse faster", }, hideClass: { - popup: "animated zoomOut faster" - } + popup: "animated zoomOut faster", + }, }); window.location.assign( - this.$props.downloadStableUrl || this.$data.browserDownloadUrl || RELEASE_URL + this.$props.downloadStableUrl || + this.$data.browserDownloadUrl || + RELEASE_URL + ); + window.ga( + "send", + "event", + "Action", + "Download", + this.downloadStableTag ); - window.ga("send", "event", "Action", "Download", this.downloadStableTag); }, downloadPreview() { this.$swal({ title: "Downloading", - text: this.downloadPreviewLabel + " version is being downloaded.", + text: `${this.downloadPreviewLabel} version is being downloaded.`, icon: "success", focusConfirm: false, focusCancel: false, @@ -99,21 +106,27 @@ export default { timerProgressBar: true, customClass: { confirmButton: "download-confirm-button", - container: "download-container" + container: "download-container", }, showClass: { - popup: "animated pulse faster" + popup: "animated pulse faster", }, hideClass: { - popup: "animated zoomOut faster" - } + popup: "animated zoomOut faster", + }, }); window.location.assign( this.$props.downloadPreviewUrl || PREVIEW_URL ); - window.ga("send", "event", "Action", "Download", this.downloadPreviewTag); - } - } + window.ga( + "send", + "event", + "Action", + "Download", + this.downloadPreviewTag + ); + }, + }, }; diff --git a/src/.vuepress/components/ExtensionList.vue b/src/.vuepress/components/ExtensionList.vue index 35bea320..10e1a9c8 100644 --- a/src/.vuepress/components/ExtensionList.vue +++ b/src/.vuepress/components/ExtensionList.vue @@ -54,24 +54,26 @@ const EXTENSION_JSON = export default { data() { return { - extensions: [] + extensions: [], }; }, async beforeMount() { const { data } = await axios.get(EXTENSION_JSON); const values = Object.values(groupBy(data, "lang")); - this.$data.extensions = sortBy(values, [g => this.langName(g[0].lang)]); + this.$data.extensions = sortBy(values, [ + (g) => this.langName(g[0].lang), + ]); }, updated() { - if (location.hash) { - location.replace(location.hash); + if (window.ocation.hash) { + window.location.replace(window.location.hash); } }, methods: { - langName: code => + langName: (code) => code === "all" ? "All" : `${ISO6391.getName(code)} (${ISO6391.getNativeName(code)})`, @@ -79,9 +81,9 @@ export default { const pkgName = pkg.substring(0, pkg.lastIndexOf(".")); return `https://raw.githubusercontent.com/inorichi/tachiyomi-extensions/repo/icon/${pkgName}.png`; }, - apkUrl: apk => - `https://raw.githubusercontent.com/inorichi/tachiyomi-extensions/repo/apk/${apk}` - } + apkUrl: (apk) => + `https://raw.githubusercontent.com/inorichi/tachiyomi-extensions/repo/apk/${apk}`, + }, }; diff --git a/src/.vuepress/components/ForkButtons.vue b/src/.vuepress/components/ForkButtons.vue index 9dc9ac97..aa6657e6 100644 --- a/src/.vuepress/components/ForkButtons.vue +++ b/src/.vuepress/components/ForkButtons.vue @@ -1,9 +1,17 @@