diff --git a/website/.eslintignore b/website/.eslintignore deleted file mode 100644 index 195967b8..00000000 --- a/website/.eslintignore +++ /dev/null @@ -1,12 +0,0 @@ -*.sh -*.md -*.woff -*.ttf -.vscode -.idea -.husky -.local -dist -node_modules -!docs/.vitepress -docs/.vitepress/cache diff --git a/website/.eslintrc.cjs b/website/.eslintrc.cjs deleted file mode 100644 index a44fd0aa..00000000 --- a/website/.eslintrc.cjs +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = { - root: true, - extends: ["@antfu"], - rules: { - "comma-dangle": ["error", "only-multiline"], - "quotes": "off", - "no-tabs": "off", - "arrow-parens": ["error", "always"], - "@typescript-eslint/quotes": ["error", "double", { avoidEscape: true }], - "indent": "off", - "semi": ["error", "never"], - "@typescript-eslint/indent": ["error", "tab"], - "@typescript-eslint/brace-style": ["error", "1tbs"], - "@typescript-eslint/semi": ["error", "never"], - "vue/no-extra-parens": "off", - "vue/html-indent": ["error", "tab"], - "curly": ["error", "all"], - "brace-style": ["error", "1tbs"], - "no-console": "off", - "no-debugger": "off", - "vue/multi-word-component-names": "off", - "vue/comment-directive": "off", - "no-unused-vars": "off", - "vue/no-parsing-error": [ - 2, - { - "x-invalid-end-tag": false, - "missing-semicolon-after-character-reference": false, - }, - ], - - /* --ECMAScript 6 ES6-- */ - "no-useless-escape": "off", - "no-unused-expressions": [ - "error", - { allowShortCircuit: true, allowTernary: true }, - ], - }, -} diff --git a/website/.markdownlint.json b/website/.markdownlint.json index 9f66c897..8548e0bd 100644 --- a/website/.markdownlint.json +++ b/website/.markdownlint.json @@ -1,3 +1,3 @@ { - "extends": "markdownlint/style/prettier" + "extends": "markdownlint/style/prettier" } diff --git a/website/.stylelintrc.cjs b/website/.stylelintrc.cjs index 264ba2f2..63aaa240 100644 --- a/website/.stylelintrc.cjs +++ b/website/.stylelintrc.cjs @@ -1,25 +1,25 @@ module.exports = { - plugins: ["stylelint-stylus"], - rules: { - "stylus/pythonic": "never", - "stylus/declaration-colon": "always", - "stylus/semicolon": "never", - "stylus/single-line-comment-double-slash-space-after": "always", - "stylus/property-no-unknown": null, - "stylus/selector-type-no-unknown": null, - "stylus/selector-list-comma": "always", - "stylus/indentation": [ - "tab", - { - indentInsideParens: "twice", - }, - ], - "rule-empty-line-before": [ - "always", - { - except: ["first-nested"], - }, - ], - }, - extends: ["stylelint-stylus/standard"], + plugins: ['stylelint-stylus'], + rules: { + 'stylus/pythonic': 'never', + 'stylus/declaration-colon': 'always', + 'stylus/semicolon': 'never', + 'stylus/single-line-comment-double-slash-space-after': 'always', + 'stylus/property-no-unknown': null, + 'stylus/selector-type-no-unknown': null, + 'stylus/selector-list-comma': 'always', + 'stylus/indentation': [ + 'tab', + { + indentInsideParens: 'twice', + }, + ], + 'rule-empty-line-before': [ + 'always', + { + except: ['first-nested'], + }, + ], + }, + extends: ['stylelint-stylus/standard'], } diff --git a/website/eslint.config.js b/website/eslint.config.js new file mode 100644 index 00000000..6eb74cf1 --- /dev/null +++ b/website/eslint.config.js @@ -0,0 +1,63 @@ +import antfu from '@antfu/eslint-config' +import { FlatCompat } from '@eslint/eslintrc' + +const compat = new FlatCompat() + +export default antfu({ + ignores: [ + '*.sh', + '*.md', + '*.woff', + '*.ttf', + '.vscode/**', + '.idea/**', + '.husky/**', + '.local/**', + 'dist/**', + 'node_modules/**', + '!docs/.vitepress/**', + 'docs/.vitepress/cache/**', + ], + + ...compat.config({ + rules: { + 'comma-dangle': ['error', 'only-multiline'], + 'quotes': 'off', + 'no-tabs': 'off', + 'arrow-parens': ['error', 'always'], + '@typescript-eslint/quotes': [ + 'error', + 'double', + { avoidEscape: true }, + ], + 'indent': 'off', + 'semi': ['error', 'never'], + '@typescript-eslint/indent': ['error', 'tab'], + '@typescript-eslint/brace-style': ['error', '1tbs'], + '@typescript-eslint/semi': ['error', 'never'], + 'vue/no-extra-parens': 'off', + 'vue/html-indent': ['error', 'tab'], + 'curly': ['error', 'all'], + 'brace-style': ['error', '1tbs'], + 'no-console': 'off', + 'no-debugger': 'off', + 'vue/multi-word-component-names': 'off', + 'vue/comment-directive': 'off', + 'no-unused-vars': 'off', + 'vue/no-parsing-error': [ + 2, + { + 'x-invalid-end-tag': false, + 'missing-semicolon-after-character-reference': false, + }, + ], + + /* --ECMAScript 6 ES6-- */ + 'no-useless-escape': 'off', + 'no-unused-expressions': [ + 'error', + { allowShortCircuit: true, allowTernary: true }, + ], + }, + }), +}) diff --git a/website/package.json b/website/package.json index acd2a720..9eb1c251 100644 --- a/website/package.json +++ b/website/package.json @@ -1,87 +1,88 @@ { - "name": "tachiyomi-website", - "version": "3.0.0", - "description": "Official website for the Tachiyomi app.", - "license": "MPL-2.0", - "private": true, - "type": "module", - "engines": { - "node": ">=20", - "pnpm": ">=8" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/tachiyomiorg/website.git" - }, - "bugs": { - "url": "https://github.com/tachiyomiorg/website/issues" - }, - "scripts": { - "preinstall": "npx only-allow pnpm", - "test": "pnpm lint && pnpm build && pnpm preview", - "dev": "vitepress dev src", - "build": "vitepress build src", - "preview": "vitepress preview src", - "lint": "pnpm lint:es && pnpm lint:mdl && pnpm lint:style", - "lint:fix": "pnpm lint:es:fix && pnpm lint:style:fix", - "lint:es": "eslint . --ext .vue,.js,.ts,.cjs,.mjs,.jsx,.tsx", - "lint:es:fix": "eslint . --ext .vue,.js,.ts,.cjs,.mjs,.jsx,.tsx --fix", - "lint:mdl": "markdownlint \"**/*.md\" \".github/**/*.md\" --enable sentences-per-line --disable MD025 MD033", - "lint:style": "stylelint \"**/*.{styl,vue}\" \"src/.vitepress/**/*.{styl,vue}\"", - "lint:style:fix": "stylelint --fix \"**/*.{styl,vue}\" \"src/.vitepress/**/*.{styl,vue}\"" - }, - "dependencies": { - "@iconify-prerendered/vue-mdi": "0.23.1698215149", - "@octokit/rest": "20.0.2", - "@octokit/types": "12.2.0", - "@tanstack/vue-query": "5.8.1", - "@vueuse/core": "10.6.0", - "axios": "1.6.1", - "element-plus": "2.4.2", - "lodash.groupby": "4.6.0", - "markdown-it": "13.0.2", - "markdown-it-shortcode-tag": "1.1.0", - "moment": "2.29.4" - }, - "devDependencies": { - "@antfu/eslint-config": "1.1.1", - "@mdit/plugin-attrs": "0.6.5", - "@mdit/plugin-figure": "0.6.5", - "@mdit/plugin-img-lazyload": "0.6.5", - "@mdit/plugin-img-mark": "0.6.5", - "@mdit/plugin-img-size": "0.6.5", - "@mdit/plugin-include": "0.6.5", - "@resvg/resvg-js": "2.6.0", - "@types/gtag.js": "0.0.18", - "@types/lodash.groupby": "4.6.9", - "@types/markdown-it": "13.0.6", - "@types/node": "20.9.0", - "@typescript-eslint/eslint-plugin": "6.10.0", - "@typescript-eslint/parser": "6.10.0", - "eslint": "8.53.0", - "eslint-config-standard": "17.1.0", - "eslint-plugin-vue": "9.18.1", - "feed": "4.2.2", - "lint-staged": "15.0.2", - "markdownlint": "0.31.1", - "markdownlint-cli": "0.37.0", - "sentences-per-line": "0.2.1", - "stylelint": "15.11.0", - "stylelint-stylus": "0.18.0", - "stylus": "0.61.0", - "unplugin-element-plus": "0.8.0", - "vite-plugin-eslint": "1.8.1", - "vitepress": "1.0.0-rc.25", - "vitepress-plugin-tabs": "0.4.1", - "vue": "3.3.8", - "vue-eslint-parser": "9.3.2", - "x-satori": "0.1.5" - }, - "simple-git-hooks": { - "pre-commit": "pnpm lint-staged" - }, - "lint-staged": { - "*.{styl,vue}": "stylelint --fix", - "*.{html,json}": "prettier --write" - } + "name": "tachiyomi-website", + "type": "module", + "version": "3.0.0", + "private": true, + "description": "Official website for the Tachiyomi app.", + "license": "MPL-2.0", + "repository": { + "type": "git", + "url": "git+https://github.com/tachiyomiorg/website.git" + }, + "bugs": { + "url": "https://github.com/tachiyomiorg/website/issues" + }, + "engines": { + "node": ">=20", + "pnpm": ">=8" + }, + "scripts": { + "preinstall": "npx only-allow pnpm", + "test": "pnpm lint && pnpm build && pnpm preview", + "dev": "vitepress dev src", + "build": "vitepress build src", + "preview": "vitepress preview src", + "lint": "pnpm lint:es && pnpm lint:mdl && pnpm lint:style", + "lint:fix": "pnpm lint:es:fix && pnpm lint:style:fix", + "lint:es": "eslint . ", + "lint:es:fix": "eslint . --fix", + "lint:mdl": "markdownlint \"**/*.md\" \".github/**/*.md\" --enable sentences-per-line --disable MD025 MD033", + "lint:style": "stylelint \"**/*.{styl,vue}\" \"src/.vitepress/**/*.{styl,vue}\"", + "lint:style:fix": "stylelint --fix \"**/*.{styl,vue}\" \"src/.vitepress/**/*.{styl,vue}\"" + }, + "dependencies": { + "@iconify-prerendered/vue-mdi": "0.23.1698215149", + "@octokit/rest": "20.0.2", + "@octokit/types": "12.2.0", + "@tanstack/vue-query": "5.8.1", + "@vueuse/core": "10.6.0", + "axios": "1.6.1", + "element-plus": "2.4.2", + "lodash.groupby": "4.6.0", + "markdown-it": "13.0.2", + "markdown-it-shortcode-tag": "1.1.0", + "moment": "2.29.4" + }, + "devDependencies": { + "@antfu/eslint-config": "^1.1.1", + "@eslint/eslintrc": "^2.1.3", + "@mdit/plugin-attrs": "0.6.5", + "@mdit/plugin-figure": "0.6.5", + "@mdit/plugin-img-lazyload": "0.6.5", + "@mdit/plugin-img-mark": "0.6.5", + "@mdit/plugin-img-size": "0.6.5", + "@mdit/plugin-include": "0.6.5", + "@resvg/resvg-js": "2.6.0", + "@types/gtag.js": "0.0.18", + "@types/lodash.groupby": "4.6.9", + "@types/markdown-it": "13.0.6", + "@types/node": "20.9.0", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", + "eslint": "8.53.0", + "eslint-config-standard": "17.1.0", + "eslint-plugin-vue": "9.18.1", + "feed": "4.2.2", + "lint-staged": "15.0.2", + "markdownlint": "0.31.1", + "markdownlint-cli": "0.37.0", + "sentences-per-line": "0.2.1", + "stylelint": "15.11.0", + "stylelint-stylus": "0.18.0", + "stylus": "0.61.0", + "unplugin-element-plus": "0.8.0", + "vite-plugin-eslint": "1.8.1", + "vitepress": "1.0.0-rc.25", + "vitepress-plugin-tabs": "0.4.1", + "vue": "3.3.8", + "vue-eslint-parser": "9.3.2", + "x-satori": "0.1.5" + }, + "simple-git-hooks": { + "pre-commit": "pnpm lint-staged" + }, + "lint-staged": { + "*.{styl,vue}": "stylelint --fix", + "*.{html,json}": "prettier --write" + } } diff --git a/website/pnpm-lock.yaml b/website/pnpm-lock.yaml index 32104170..13a46aca 100644 --- a/website/pnpm-lock.yaml +++ b/website/pnpm-lock.yaml @@ -41,8 +41,11 @@ dependencies: devDependencies: '@antfu/eslint-config': - specifier: 1.1.1 + specifier: ^1.1.1 version: 1.1.1(eslint@8.53.0)(typescript@5.2.2) + '@eslint/eslintrc': + specifier: ^2.1.3 + version: 2.1.3 '@mdit/plugin-attrs': specifier: 0.6.5 version: 0.6.5(markdown-it@13.0.2) @@ -87,7 +90,7 @@ devDependencies: version: 8.53.0 eslint-config-standard: specifier: 17.1.0 - version: 17.1.0(eslint-plugin-import@2.28.1)(eslint-plugin-n@16.2.0)(eslint-plugin-promise@6.1.1)(eslint@8.53.0) + version: 17.1.0(eslint-plugin-import@2.28.1)(eslint-plugin-n@16.3.1)(eslint-plugin-promise@6.1.1)(eslint@8.53.0) eslint-plugin-vue: specifier: 9.18.1 version: 9.18.1(eslint@8.53.0) @@ -693,7 +696,7 @@ packages: ajv: 6.12.6 debug: 4.3.4 espree: 9.6.1 - globals: 13.21.0 + globals: 13.23.0 ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -2663,7 +2666,7 @@ packages: parse-gitignore: 2.0.0 dev: true - /eslint-config-standard@17.1.0(eslint-plugin-import@2.28.1)(eslint-plugin-n@16.2.0)(eslint-plugin-promise@6.1.1)(eslint@8.53.0): + /eslint-config-standard@17.1.0(eslint-plugin-import@2.28.1)(eslint-plugin-n@16.3.1)(eslint-plugin-promise@6.1.1)(eslint@8.53.0): resolution: {integrity: sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==} engines: {node: '>=12.0.0'} peerDependencies: @@ -2674,7 +2677,7 @@ packages: dependencies: eslint: 8.53.0 eslint-plugin-import: 2.28.1(@typescript-eslint/parser@6.10.0)(eslint@8.53.0) - eslint-plugin-n: 16.2.0(eslint@8.53.0) + eslint-plugin-n: 16.3.1(eslint@8.53.0) eslint-plugin-promise: 6.1.1(eslint@8.53.0) dev: true @@ -2850,24 +2853,6 @@ packages: - supports-color dev: true - /eslint-plugin-n@16.2.0(eslint@8.53.0): - resolution: {integrity: sha512-AQER2jEyQOt1LG6JkGJCCIFotzmlcCZFur2wdKrp1JX2cNotC7Ae0BcD/4lLv3lUAArM9uNS8z/fsvXTd0L71g==} - engines: {node: '>=16.0.0'} - peerDependencies: - eslint: '>=7.0.0' - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.53.0) - builtins: 5.0.1 - eslint: 8.53.0 - eslint-plugin-es-x: 7.2.0(eslint@8.53.0) - get-tsconfig: 4.7.0 - ignore: 5.2.4 - is-core-module: 2.13.0 - minimatch: 3.1.2 - resolve: 1.22.6 - semver: 7.5.4 - dev: true - /eslint-plugin-n@16.3.1(eslint@8.53.0): resolution: {integrity: sha512-w46eDIkxQ2FaTHcey7G40eD+FhTXOdKudDXPUO2n9WNcslze/i/HT2qJ3GXjHngYSGDISIgPNhwGtgoix4zeOw==} engines: {node: '>=16.0.0'} diff --git a/website/src/.vitepress/theme/components/CustomSwitchAppearance.vue b/website/src/.vitepress/theme/components/CustomSwitchAppearance.vue index f7da0758..02ccc4bd 100644 --- a/website/src/.vitepress/theme/components/CustomSwitchAppearance.vue +++ b/website/src/.vitepress/theme/components/CustomSwitchAppearance.vue @@ -1,41 +1,41 @@