lint code

pull/1583/head
lyswhut 2023-08-27 15:09:07 +08:00
parent 0d76c9ccb4
commit 71b84fb10d
69 changed files with 346 additions and 413 deletions

View File

@ -29,13 +29,22 @@ const typescriptRule = {
allowBoolean: true, allowBoolean: true,
allowAny: true, allowAny: true,
}], }],
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: {
arguments: false,
attributes: false,
},
},
],
'@typescript-eslint/naming-convention': 'off', '@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/return-await': 'off', '@typescript-eslint/return-await': 'off',
'@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/comma-dangle': 'off', '@typescript-eslint/comma-dangle': 'off',
} }
const vueRule = { const vueRule = {
...baseRule, ...typescriptRule,
'vue/multi-word-component-names': 'off', 'vue/multi-word-component-names': 'off',
'vue/max-attributes-per-line': 'off', 'vue/max-attributes-per-line': 'off',
'vue/singleline-html-element-content-newline': 'off', 'vue/singleline-html-element-content-newline': 'off',

View File

@ -6,9 +6,8 @@ module.exports = {
'del', 'del',
'comlink', 'comlink',
'vue', 'vue',
'eslint-plugin-n',
'@types/ws', '@types/ws',
'eslint-config-standard-with-typescript', // 'eslint-config-standard-with-typescript',
], ],
// target: 'newest', // target: 'newest',

370
package-lock.json generated
View File

@ -68,7 +68,7 @@
"electron-updater": "^6.1.4", "electron-updater": "^6.1.4",
"eslint": "^8.47.0", "eslint": "^8.47.0",
"eslint-config-standard": "^17.1.0", "eslint-config-standard": "^17.1.0",
"eslint-config-standard-with-typescript": "^35.0.0", "eslint-config-standard-with-typescript": "^38.1.0",
"eslint-formatter-friendly": "github:lyswhut/eslint-friendly-formatter#2170d1320e2fad13615a9dcf229669f0bb473a53", "eslint-formatter-friendly": "github:lyswhut/eslint-friendly-formatter#2170d1320e2fad13615a9dcf229669f0bb473a53",
"eslint-plugin-html": "^7.1.0", "eslint-plugin-html": "^7.1.0",
"eslint-plugin-vue": "^9.17.0", "eslint-plugin-vue": "^9.17.0",
@ -3145,33 +3145,34 @@
} }
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz",
"integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.4.0", "@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/type-utils": "5.62.0", "@typescript-eslint/type-utils": "6.4.1",
"@typescript-eslint/utils": "5.62.0", "@typescript-eslint/utils": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
"ignore": "^5.2.0", "ignore": "^5.2.4",
"natural-compare-lite": "^1.4.0", "natural-compare": "^1.4.0",
"semver": "^7.3.7", "semver": "^7.5.4",
"tsutils": "^3.21.0" "ts-api-utils": "^1.0.1"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/parser": "^5.0.0", "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha",
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" "eslint": "^7.0.0 || ^8.0.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"typescript": { "typescript": {
@ -3180,25 +3181,26 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz",
"integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/typescript-estree": "5.62.0", "@typescript-eslint/typescript-estree": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" "eslint": "^7.0.0 || ^8.0.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"typescript": { "typescript": {
@ -3207,16 +3209,16 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz",
"integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", "integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/visitor-keys": "5.62.0" "@typescript-eslint/visitor-keys": "6.4.1"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -3224,26 +3226,26 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz",
"integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", "integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@typescript-eslint/typescript-estree": "5.62.0", "@typescript-eslint/typescript-estree": "6.4.1",
"@typescript-eslint/utils": "5.62.0", "@typescript-eslint/utils": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"tsutils": "^3.21.0" "ts-api-utils": "^1.0.1"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "*" "eslint": "^7.0.0 || ^8.0.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"typescript": { "typescript": {
@ -3252,12 +3254,12 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz",
"integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -3265,21 +3267,21 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz",
"integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/visitor-keys": "5.62.0", "@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"globby": "^11.1.0", "globby": "^11.1.0",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
"semver": "^7.3.7", "semver": "^7.5.4",
"tsutils": "^3.21.0" "ts-api-utils": "^1.0.1"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -3292,43 +3294,42 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz",
"integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", "integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.9", "@types/json-schema": "^7.0.12",
"@types/semver": "^7.3.12", "@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/typescript-estree": "5.62.0", "@typescript-eslint/typescript-estree": "6.4.1",
"eslint-scope": "^5.1.1", "semver": "^7.5.4"
"semver": "^7.3.7"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" "eslint": "^7.0.0 || ^8.0.0"
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz",
"integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.4.1",
"eslint-visitor-keys": "^3.3.0" "eslint-visitor-keys": "^3.4.1"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^16.0.0 || >=18.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -7445,49 +7446,23 @@
} }
}, },
"node_modules/eslint-config-standard-with-typescript": { "node_modules/eslint-config-standard-with-typescript": {
"version": "35.0.0", "version": "38.1.0",
"resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-35.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-38.1.0.tgz",
"integrity": "sha512-Xa7DY9GgduZyp0qmXxBF0/dB+Vm4/DgWu1lGpNLJV2d46aCaUxTKDEnkzjUWX/1O9S0a+Dhnw7A4oI0JpYzwtw==", "integrity": "sha512-sdgN8Gf7BMVhVKlY7/mB426yO/MozU1zV7TKnh0z1wIoPq4lD0CHQ+b/UkgqKfiZ4Io0j3xIY1j+lHhVXQck0g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/parser": "^5.50.0", "@typescript-eslint/parser": "^6.1.0",
"eslint-config-standard": "17.0.0" "eslint-config-standard": "17.1.0"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/eslint-plugin": "^5.50.0", "@typescript-eslint/eslint-plugin": "^6.1.0",
"eslint": "^8.0.1", "eslint": "^8.0.1",
"eslint-plugin-import": "^2.25.2", "eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0", "eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
"eslint-plugin-promise": "^6.0.0", "eslint-plugin-promise": "^6.0.0",
"typescript": "*" "typescript": "*"
} }
}, },
"node_modules/eslint-config-standard-with-typescript/node_modules/eslint-config-standard": {
"version": "17.0.0",
"resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz",
"integrity": "sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"peerDependencies": {
"eslint": "^8.0.1",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-promise": "^6.0.0"
}
},
"node_modules/eslint-formatter-friendly": { "node_modules/eslint-formatter-friendly": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "git+ssh://git@github.com/lyswhut/eslint-friendly-formatter.git#2170d1320e2fad13615a9dcf229669f0bb473a53", "resolved": "git+ssh://git@github.com/lyswhut/eslint-friendly-formatter.git#2170d1320e2fad13615a9dcf229669f0bb473a53",
@ -11245,13 +11220,6 @@
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
"dev": true "dev": true
}, },
"node_modules/natural-compare-lite": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz",
"integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==",
"dev": true,
"peer": true
},
"node_modules/needle": { "node_modules/needle": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "git+ssh://git@github.com/lyswhut/needle.git#93299ac841b7e9a9f82ca7279b88aaaeda404060", "resolved": "git+ssh://git@github.com/lyswhut/needle.git#93299ac841b7e9a9f82ca7279b88aaaeda404060",
@ -16293,6 +16261,18 @@
"utf8-byte-length": "^1.0.1" "utf8-byte-length": "^1.0.1"
} }
}, },
"node_modules/ts-api-utils": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz",
"integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==",
"dev": true,
"engines": {
"node": ">=16.13.0"
},
"peerDependencies": {
"typescript": ">=4.2.0"
}
},
"node_modules/ts-loader": { "node_modules/ts-loader": {
"version": "9.4.4", "version": "9.4.4",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.4.tgz", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.4.tgz",
@ -16331,27 +16311,6 @@
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==",
"dev": true "dev": true
}, },
"node_modules/tsutils": {
"version": "3.21.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz",
"integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==",
"dev": true,
"dependencies": {
"tslib": "^1.8.1"
},
"engines": {
"node": ">= 6"
},
"peerDependencies": {
"typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"
}
},
"node_modules/tsutils/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
},
"node_modules/tunnel": { "node_modules/tunnel": {
"version": "0.0.6", "version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
@ -19924,105 +19883,106 @@
} }
}, },
"@typescript-eslint/eslint-plugin": { "@typescript-eslint/eslint-plugin": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz",
"integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"requires": { "requires": {
"@eslint-community/regexpp": "^4.4.0", "@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/type-utils": "5.62.0", "@typescript-eslint/type-utils": "6.4.1",
"@typescript-eslint/utils": "5.62.0", "@typescript-eslint/utils": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
"ignore": "^5.2.0", "ignore": "^5.2.4",
"natural-compare-lite": "^1.4.0", "natural-compare": "^1.4.0",
"semver": "latest", "semver": "latest",
"tsutils": "^3.21.0" "ts-api-utils": "^1.0.1"
} }
}, },
"@typescript-eslint/parser": { "@typescript-eslint/parser": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz",
"integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/typescript-estree": "5.62.0", "@typescript-eslint/typescript-estree": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4" "debug": "^4.3.4"
} }
}, },
"@typescript-eslint/scope-manager": { "@typescript-eslint/scope-manager": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz",
"integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", "integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/visitor-keys": "5.62.0" "@typescript-eslint/visitor-keys": "6.4.1"
} }
}, },
"@typescript-eslint/type-utils": { "@typescript-eslint/type-utils": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz",
"integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", "integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"requires": { "requires": {
"@typescript-eslint/typescript-estree": "5.62.0", "@typescript-eslint/typescript-estree": "6.4.1",
"@typescript-eslint/utils": "5.62.0", "@typescript-eslint/utils": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"tsutils": "^3.21.0" "ts-api-utils": "^1.0.1"
} }
}, },
"@typescript-eslint/types": { "@typescript-eslint/types": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz",
"integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==",
"dev": true "dev": true
}, },
"@typescript-eslint/typescript-estree": { "@typescript-eslint/typescript-estree": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz",
"integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/visitor-keys": "5.62.0", "@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"globby": "^11.1.0", "globby": "^11.1.0",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
"semver": "latest", "semver": "latest",
"tsutils": "^3.21.0" "ts-api-utils": "^1.0.1"
} }
}, },
"@typescript-eslint/utils": { "@typescript-eslint/utils": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz",
"integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", "integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"requires": { "requires": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.9", "@types/json-schema": "^7.0.12",
"@types/semver": "^7.3.12", "@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/typescript-estree": "5.62.0", "@typescript-eslint/typescript-estree": "6.4.1",
"eslint-scope": "^5.1.1",
"semver": "latest" "semver": "latest"
} }
}, },
"@typescript-eslint/visitor-keys": { "@typescript-eslint/visitor-keys": {
"version": "5.62.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz",
"integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "5.62.0", "@typescript-eslint/types": "6.4.1",
"eslint-visitor-keys": "^3.3.0" "eslint-visitor-keys": "^3.4.1"
}, },
"dependencies": { "dependencies": {
"eslint-visitor-keys": { "eslint-visitor-keys": {
@ -23246,22 +23206,13 @@
"requires": {} "requires": {}
}, },
"eslint-config-standard-with-typescript": { "eslint-config-standard-with-typescript": {
"version": "35.0.0", "version": "38.1.0",
"resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-35.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-38.1.0.tgz",
"integrity": "sha512-Xa7DY9GgduZyp0qmXxBF0/dB+Vm4/DgWu1lGpNLJV2d46aCaUxTKDEnkzjUWX/1O9S0a+Dhnw7A4oI0JpYzwtw==", "integrity": "sha512-sdgN8Gf7BMVhVKlY7/mB426yO/MozU1zV7TKnh0z1wIoPq4lD0CHQ+b/UkgqKfiZ4Io0j3xIY1j+lHhVXQck0g==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/parser": "^5.50.0", "@typescript-eslint/parser": "^6.1.0",
"eslint-config-standard": "17.0.0" "eslint-config-standard": "17.1.0"
},
"dependencies": {
"eslint-config-standard": {
"version": "17.0.0",
"resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz",
"integrity": "sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==",
"dev": true,
"requires": {}
}
} }
}, },
"eslint-formatter-friendly": { "eslint-formatter-friendly": {
@ -26043,13 +25994,6 @@
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
"dev": true "dev": true
}, },
"natural-compare-lite": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz",
"integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==",
"dev": true,
"peer": true
},
"needle": { "needle": {
"version": "git+ssh://git@github.com/lyswhut/needle.git#93299ac841b7e9a9f82ca7279b88aaaeda404060", "version": "git+ssh://git@github.com/lyswhut/needle.git#93299ac841b7e9a9f82ca7279b88aaaeda404060",
"integrity": "sha512-NWwNanpqTqgHWYRLhd1nXwsDh83A8592gWWYz/lUbUd34PITOzzNuL8H0ipbdjFvWBRLPcQqVSn9Sx8RR1htIA==", "integrity": "sha512-NWwNanpqTqgHWYRLhd1nXwsDh83A8592gWWYz/lUbUd34PITOzzNuL8H0ipbdjFvWBRLPcQqVSn9Sx8RR1htIA==",
@ -29918,6 +29862,13 @@
"utf8-byte-length": "^1.0.1" "utf8-byte-length": "^1.0.1"
} }
}, },
"ts-api-utils": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz",
"integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==",
"dev": true,
"requires": {}
},
"ts-loader": { "ts-loader": {
"version": "9.4.4", "version": "9.4.4",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.4.tgz", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.4.tgz",
@ -29949,23 +29900,6 @@
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==",
"dev": true "dev": true
}, },
"tsutils": {
"version": "3.21.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz",
"integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
"dev": true
}
}
},
"tunnel": { "tunnel": {
"version": "0.0.6", "version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",

View File

@ -238,7 +238,7 @@
"electron-updater": "^6.1.4", "electron-updater": "^6.1.4",
"eslint": "^8.47.0", "eslint": "^8.47.0",
"eslint-config-standard": "^17.1.0", "eslint-config-standard": "^17.1.0",
"eslint-config-standard-with-typescript": "^35.0.0", "eslint-config-standard-with-typescript": "^38.1.0",
"eslint-formatter-friendly": "github:lyswhut/eslint-friendly-formatter#2170d1320e2fad13615a9dcf229669f0bb473a53", "eslint-formatter-friendly": "github:lyswhut/eslint-friendly-formatter#2170d1320e2fad13615a9dcf229669f0bb473a53",
"eslint-plugin-html": "^7.1.0", "eslint-plugin-html": "^7.1.0",
"eslint-plugin-vue": "^9.17.0", "eslint-plugin-vue": "^9.17.0",

View File

@ -270,7 +270,7 @@ class Task extends EventEmitter {
const result = this.__handleDiffChunk(chunk) const result = this.__handleDiffChunk(chunk)
if (result) chunk = result if (result) chunk = result
else { else {
this.__handleStop().finally(() => { void this.__handleStop().finally(() => {
// this.__handleError(new Error('Resume failed, response chunk does not match.')) // this.__handleError(new Error('Resume failed, response chunk does not match.'))
// Resume failed, response chunk does not match, remove file and restart download // Resume failed, response chunk does not match, remove file and restart download
console.log('Resume failed, response chunk does not match.') console.log('Resume failed, response chunk does not match.')

View File

@ -65,7 +65,7 @@ export default {
}) })
const menuClick = (item) => { const menuClick = (item) => {
if (item && item.disabled) return if (item?.disabled) return
emit('menu-click', item) emit('menu-click', item)
} }

View File

@ -28,7 +28,7 @@ const easeInOutQuad = (t, b, c, d) => {
return (-c / 2) * (t * (t - 2) - 1) + b return (-c / 2) * (t * (t - 2) - 1) + b
} }
const handleScroll = (element, to, duration = 300, callback = () => {}, onCancel = () => {}) => { const handleScroll = (element, to, duration = 300, callback = () => {}, onCancel = () => {}) => {
if (!element) return callback() if (!element) { callback(); return }
const start = element.scrollTop || element.scrollY || 0 const start = element.scrollTop || element.scrollY || 0
let cancel = false let cancel = false
if (to > start) { if (to > start) {
@ -36,10 +36,10 @@ const handleScroll = (element, to, duration = 300, callback = () => {}, onCancel
if (to > maxScrollTop) to = maxScrollTop if (to > maxScrollTop) to = maxScrollTop
} else if (to < start) { } else if (to < start) {
if (to < 0) to = 0 if (to < 0) to = 0
} else return callback() } else { callback(); return }
const change = to - start const change = to - start
const increment = 10 const increment = 10
if (!change) return callback() if (!change) { callback(); return }
let currentTime = 0 let currentTime = 0
let val let val
@ -145,7 +145,7 @@ export default {
case 'down': case 'down':
break break
default: default:
console.log(render(null, slots.default(list[0])[0])) render(null, slots.default(list[0])[0])
break break
} }
} }
@ -196,14 +196,14 @@ export default {
emit('scroll', event) emit('scroll', event)
} }
const scrollTo = (scrollTop, animate = false) => { const scrollTo = async(scrollTop, animate = false) => {
return new Promise(resolve => { return new Promise(resolve => {
if (cancelScroll) { if (cancelScroll) {
cancelScroll(resolve) cancelScroll(resolve)
} else { } else {
resolve() resolve()
} }
}).then(() => { }).then(async() => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (animate) { if (animate) {
isScrolling = true isScrolling = true
@ -224,7 +224,7 @@ export default {
}) })
} }
const scrollToIndex = (index, offset = 0, animate = false) => { const scrollToIndex = async(index, offset = 0, animate = false) => {
return scrollTo(Math.max(index * props.itemHeight + offset, 0), animate) return scrollTo(Math.max(index * props.itemHeight + offset, 0), animate)
} }
@ -245,7 +245,7 @@ export default {
cachedList = Array(list.length) cachedList = Array(list.length)
startIndex = -1 startIndex = -1
endIndex = -1 endIndex = -1
nextTick(() => { void nextTick(() => {
updateView(true) updateView(true)
}) })
} }

View File

@ -22,13 +22,11 @@ import { ref, watch, onMounted, onBeforeUnmount, reactive } from '@common/utils/
// https://github.com/vuejs/core/issues/2855#issuecomment-768388962 // https://github.com/vuejs/core/issues/2855#issuecomment-768388962
import { import {
Teleport as teleport_, Teleport as teleport_,
TeleportProps, type TeleportProps,
VNodeProps, type VNodeProps,
} from 'vue' } from 'vue'
const Teleport = teleport_ as { const Teleport = teleport_ as new () => {
new (): { $props: VNodeProps & TeleportProps
$props: VNodeProps & TeleportProps
}
} }
const props = defineProps<{ const props = defineProps<{

View File

@ -50,7 +50,7 @@ const easeInOutQuad = (t, b, c, d) => {
return (-c / 2) * (t * (t - 2) - 1) + b return (-c / 2) * (t * (t - 2) - 1) + b
} }
const handleScroll = (element, to, duration = 300, callback = () => {}, onCancel = () => {}) => { const handleScroll = (element, to, duration = 300, callback = () => {}, onCancel = () => {}) => {
if (!element) return callback() if (!element) { callback(); return }
const start = element.scrollTop || element.scrollY || 0 const start = element.scrollTop || element.scrollY || 0
let cancel = false let cancel = false
if (to > start) { if (to > start) {
@ -58,10 +58,10 @@ const handleScroll = (element, to, duration = 300, callback = () => {}, onCancel
if (to > maxScrollTop) to = maxScrollTop if (to > maxScrollTop) to = maxScrollTop
} else if (to < start) { } else if (to < start) {
if (to < 0) to = 0 if (to < 0) to = 0
} else return callback() } else { callback(); return }
const change = to - start const change = to - start
const increment = 10 const increment = 10
if (!change) return callback() if (!change) { callback(); return }
let currentTime = 0 let currentTime = 0
let val let val
@ -214,7 +214,7 @@ export default {
const scrollTo = (scrollTop, animate = false, onScrollEnd) => { const scrollTo = (scrollTop, animate = false, onScrollEnd) => {
if (onScrollEnd) { if (onScrollEnd) {
new Promise(resolve => { void new Promise(resolve => {
if (cancelScroll) { if (cancelScroll) {
cancelScroll(resolve) cancelScroll(resolve)
} else { } else {
@ -270,7 +270,7 @@ export default {
cachedList = Array(list.length) cachedList = Array(list.length)
startIndex = -1 startIndex = -1
endIndex = -1 endIndex = -1
nextTick(() => { void nextTick(() => {
updateView() updateView()
}) })
} }

View File

@ -51,7 +51,7 @@ export default {
}, },
methods: { methods: {
handleClick(quality) { handleClick(quality) {
createDownloadTasks([this.musicInfo], quality) void createDownloadTasks([this.musicInfo], quality)
this.handleClose() this.handleClose()
}, },
handleClose() { handleClose() {

View File

@ -37,7 +37,7 @@ export default {
emits: ['update:show', 'confirm'], emits: ['update:show', 'confirm'],
methods: { methods: {
handleClick(quality) { handleClick(quality) {
createDownloadTasks(this.list.filter(item => item.source != 'local'), quality) void createDownloadTasks(this.list.filter(item => item.source != 'local'), quality)
this.handleClose() this.handleClose()
this.$emit('confirm') this.$emit('confirm')
}, },

View File

@ -71,7 +71,7 @@ export default {
const checkMusicExist = (musicInfo) => { const checkMusicExist = (musicInfo) => {
const mid = musicInfo.id const mid = musicInfo.id
getMusicExistListIds(mid).then(ids => { void getMusicExistListIds(mid).then(ids => {
if (mid != musicInfo.id) return if (mid != musicInfo.id) return
for (const list of lists.value) { for (const list of lists.value) {
if (ids.includes(list.id)) list.isExist = true if (ids.includes(list.id)) list.isExist = true
@ -150,9 +150,8 @@ export default {
: width < 3840 ? 5 : 6 : width < 3840 ? 5 : 6
}, },
handleClick(index) { handleClick(index) {
this.isMove if (this.isMove) void moveListMusics(this.fromListId, this.lists[index].id, [this.currentMusicInfo])
? moveListMusics(this.fromListId, this.lists[index].id, [this.currentMusicInfo]) else void addListMusics(this.lists[index].id, [this.currentMusicInfo])
: addListMusics(this.lists[index].id, [this.currentMusicInfo])
this.lists[index].isExist = true this.lists[index].isExist = true
if (this.keyModDown && !this.isMove) return if (this.keyModDown && !this.isMove) return
@ -174,7 +173,7 @@ export default {
this.newListName = event.target.value = '' this.newListName = event.target.value = ''
this.isEditing = false this.isEditing = false
if (!name) return if (!name) return
createUserList({ name }) void createUserList({ name })
}, },
}, },
} }

View File

@ -111,9 +111,8 @@ export default {
handleClick(index) { handleClick(index) {
const list = 'progress' in this.musicList[0] ? this.musicList.map(t => t.metadata.musicInfo) : this.musicList const list = 'progress' in this.musicList[0] ? this.musicList.map(t => t.metadata.musicInfo) : this.musicList
this.isMove if (this.isMove) void moveListMusics(this.fromListId, this.lists[index].id, list)
? moveListMusics(this.fromListId, this.lists[index].id, list) else void addListMusics(this.lists[index].id, list)
: addListMusics(this.lists[index].id, list)
if (this.keyModDown && !this.isMove) return if (this.keyModDown && !this.isMove) return
this.$nextTick(() => { this.$nextTick(() => {
@ -135,7 +134,7 @@ export default {
this.newListName = event.target.value = '' this.newListName = event.target.value = ''
this.isEditing = false this.isEditing = false
if (!name) return if (!name) return
createUserList({ name }) void createUserList({ name })
}, },
}, },
} }

View File

@ -25,7 +25,7 @@ const handleEditing = () => {
if (isEditing.value) return if (isEditing.value) return
// if (!this.newPresetName) this.newPresetName = this.listName // if (!this.newPresetName) this.newPresetName = this.listName
isEditing.value = true isEditing.value = true
nextTick(() => { void nextTick(() => {
input.value.$el.focus() input.value.$el.focus()
}) })
} }
@ -36,7 +36,7 @@ const handleSave = (event) => {
isEditing.value = false isEditing.value = false
if (!name) return if (!name) return
if (name.length > 20) name = name.substring(0, 20) if (name.length > 20) name = name.substring(0, 20)
saveUserConvolutionPreset({ void saveUserConvolutionPreset({
id: Date.now().toString(), id: Date.now().toString(),
name, name,
source: appSetting['player.soundEffect.convolution.fileName'], source: appSetting['player.soundEffect.convolution.fileName'],

View File

@ -18,7 +18,7 @@ const handleEditing = () => {
if (isEditing.value) return if (isEditing.value) return
// if (!this.newPresetName) this.newPresetName = this.listName // if (!this.newPresetName) this.newPresetName = this.listName
isEditing.value = true isEditing.value = true
nextTick(() => { void nextTick(() => {
input.value.$el.focus() input.value.$el.focus()
}) })
} }
@ -29,7 +29,7 @@ const handleSave = (event) => {
isEditing.value = false isEditing.value = false
if (!name) return if (!name) return
if (name.length > 20) name = name.substring(0, 20) if (name.length > 20) name = name.substring(0, 20)
saveUserEQPreset({ void saveUserEQPreset({
id: Date.now().toString(), id: Date.now().toString(),
name, name,
hz31: appSetting['player.soundEffect.biquadFilter.hz31'], hz31: appSetting['player.soundEffect.biquadFilter.hz31'],

View File

@ -69,7 +69,7 @@ const handleSetPreset = (item) => {
} }
const userPresetList = ref([]) const userPresetList = ref([])
const handleRemovePreset = id => { const handleRemovePreset = id => {
removeUserConvolutionPreset(id) void removeUserConvolutionPreset(id)
} }
const disabledConvolution = computed(() => { const disabledConvolution = computed(() => {
@ -77,7 +77,7 @@ const disabledConvolution = computed(() => {
}) })
onMounted(() => { onMounted(() => {
getUserConvolutionPresetList().then(list => { void getUserConvolutionPresetList().then(list => {
userPresetList.value = list userPresetList.value = list
}) })
}) })

View File

@ -65,11 +65,11 @@ const handleSetPreset = (item) => {
const userPresetList = ref([]) const userPresetList = ref([])
const handleRemovePreset = id => { const handleRemovePreset = id => {
removeUserEQPreset(id) void removeUserEQPreset(id)
} }
onMounted(() => { onMounted(() => {
getUserEQPresetList().then(list => { void getUserEQPresetList().then(list => {
userPresetList.value = list userPresetList.value = list
}) })
}) })

View File

@ -30,7 +30,7 @@ import { computed, ref } from '@common/utils/vueTools'
export default { export default {
setup() { setup() {
const lastStartVersion = ref(null) const lastStartVersion = ref(null)
getLastStartInfo().then(version => { void getLastStartInfo().then(version => {
lastStartVersion.value = version lastStartVersion.value = version
}) })
@ -43,7 +43,7 @@ export default {
history: [], history: [],
isLatest: true, isLatest: true,
} }
if (!versionInfo.newVersion || !versionInfo.newVersion?.history) return info if (!versionInfo.newVersion?.history) return info
info.isLatest = compareVer(currentVer, versionInfo.newVersion.version) >= 0 info.isLatest = compareVer(currentVer, versionInfo.newVersion.version) >= 0
const history = [{ version: versionInfo.newVersion.version, desc: versionInfo.newVersion.desc }, ...versionInfo.newVersion.history] const history = [{ version: versionInfo.newVersion.version, desc: versionInfo.newVersion.desc }, ...versionInfo.newVersion.history]

View File

@ -81,11 +81,11 @@ export default {
}, 2e3) }, 2e3)
}, },
handleClose(isExit) { handleClose(isExit) {
if (isExit) return quitApp(true) if (isExit) { quitApp(true); return }
isShowPact.value = false isShowPact.value = false
}, },
openUrl(url) { openUrl(url) {
openUrl(url) void openUrl(url)
}, },
startTimeout() { startTimeout() {
window.setTimeout(() => { window.setTimeout(() => {

View File

@ -101,7 +101,7 @@ export default {
const listId = playMusicInfo.listId const listId = playMusicInfo.listId
if (!listId || listId == LIST_IDS.DOWNLOAD || !playMusicInfo.musicInfo) return if (!listId || listId == LIST_IDS.DOWNLOAD || !playMusicInfo.musicInfo) return
if (playInfo.playIndex == -1) return if (playInfo.playIndex == -1) return
router.push({ void router.push({
path: '/list', path: '/list',
query: { query: {
id: listId, id: listId,

View File

@ -101,7 +101,7 @@ export default {
const listId = playMusicInfo.listId const listId = playMusicInfo.listId
if (!listId || listId == LIST_IDS.DOWNLOAD || !playMusicInfo.musicInfo) return if (!listId || listId == LIST_IDS.DOWNLOAD || !playMusicInfo.musicInfo) return
if (playInfo.playIndex == -1) return if (playInfo.playIndex == -1) return
router.push({ void router.push({
path: '/list', path: '/list',
query: { query: {
id: listId, id: listId,

View File

@ -103,7 +103,7 @@ export default {
const listId = playMusicInfo.listId const listId = playMusicInfo.listId
if (!listId || listId == LIST_IDS.DOWNLOAD || !playMusicInfo.musicInfo) return if (!listId || listId == LIST_IDS.DOWNLOAD || !playMusicInfo.musicInfo) return
if (playInfo.playIndex == -1) return if (playInfo.playIndex == -1) return
router.push({ void router.push({
path: '/list', path: '/list',
query: { query: {
id: listId, id: listId,

View File

@ -113,7 +113,7 @@ export default {
lyricMenuXY.x = event.pageX lyricMenuXY.x = event.pageX
lyricMenuXY.y = event.pageY lyricMenuXY.y = event.pageY
if (lyricMenuVisible.value) return if (lyricMenuVisible.value) return
nextTick(() => { void nextTick(() => {
lyricMenuVisible.value = true lyricMenuVisible.value = true
}) })
} }

View File

@ -55,10 +55,10 @@ const offsetTagRxp = /(?:^|\n)\s*\[offset:\s*(\S+(?:\d+)*)\s*\]/
const offsetTagAllRxp = /(^|\n)\s*\[offset:\s*(\S+(?:\d+)*)\s*\]/g const offsetTagAllRxp = /(^|\n)\s*\[offset:\s*(\S+(?:\d+)*)\s*\]/g
const saveLyric = debounce((musicInfo, lyricInfo) => { const saveLyric = debounce((musicInfo, lyricInfo) => {
saveLyricEdited(musicInfo, lyricInfo) void saveLyricEdited(musicInfo, lyricInfo)
}) })
const removeLyric = debounce(musicInfo => { const removeLyric = debounce(musicInfo => {
removeLyricEdited(musicInfo) void removeLyricEdited(musicInfo)
}) })
const getOffset = lrc => { const getOffset = lrc => {

View File

@ -138,7 +138,7 @@ export default {
visibled, visibled,
isFullscreen, isFullscreen,
fullscreenExit() { fullscreenExit() {
setFullScreen(false).then((fullscreen) => { void setFullScreen(false).then((fullscreen) => {
isFullscreen.value = fullscreen isFullscreen.value = fullscreen
}) })
}, },

View File

@ -61,7 +61,7 @@ export default {
} }
const handleSelectMode = (mode) => { const handleSelectMode = (mode) => {
if (mode.startsWith('overwrite') && isOverwrite.value) mode += '_full' if (mode.startsWith('overwrite') && isOverwrite.value) mode += '_full'
sendSyncAction({ action: 'select_mode', data: mode }) void sendSyncAction({ action: 'select_mode', data: mode })
handleClose() handleClose()
} }
return { return {

View File

@ -97,7 +97,7 @@ export default {
break break
case 'listClick': case 'listClick':
searchText.value = tipList.value[data] searchText.value = tipList.value[data]
nextTick(handleSearch) void nextTick(handleSearch)
} }
} }

View File

@ -113,7 +113,7 @@ export default {
}, },
computed: { computed: {
history() { history() {
if (!this.versionInfo.newVersion || !this.versionInfo.newVersion?.history) return [] if (!this.versionInfo.newVersion?.history) return []
let arr = [] let arr = []
let currentVer = this.versionInfo.version let currentVer = this.versionInfo.version
this.versionInfo.newVersion?.history.forEach(ver => { this.versionInfo.newVersion?.history.forEach(ver => {
@ -134,7 +134,7 @@ export default {
}, },
}, },
created() { created() {
getIgnoreVersion().then(version => { void getIgnoreVersion().then(version => {
this.ignoreVersion = version this.ignoreVersion = version
}) })
}, },
@ -143,7 +143,7 @@ export default {
versionInfo.showModal = false versionInfo.showModal = false
}, },
handleOpenUrl(url) { handleOpenUrl(url) {
openUrl(url) void openUrl(url)
}, },
handleRestartClick(event) { handleRestartClick(event) {
this.handleClose() this.handleClose()
@ -166,7 +166,7 @@ export default {
confirmButtonText: window.i18n.t('update__ignore_confirm'), confirmButtonText: window.i18n.t('update__ignore_confirm'),
})) { })) {
setTimeout(() => { setTimeout(() => {
dialog({ void dialog({
message: window.i18n.t('update__ignore_confirm_tip'), message: window.i18n.t('update__ignore_confirm_tip'),
confirmButtonText: window.i18n.t('update__ignore_confirm_tip_confirm'), confirmButtonText: window.i18n.t('update__ignore_confirm_tip_confirm'),
}) })

View File

@ -161,7 +161,7 @@ export default {
// } // }
this.setRandomAnimation() this.setRandomAnimation()
this.showModal = true this.showModal = true
nextTick(() => { void nextTick(() => {
this.$refs.dom_container.parentNode.classList.add('show-modal') this.$refs.dom_container.parentNode.classList.add('show-modal')
this.showContent = true this.showContent = true
}) })

View File

@ -234,7 +234,7 @@ export default {
handleShowDownloadModal(index, true) handleShowDownloadModal(index, true)
break break
case 'play': case 'play':
handlePlayMusic(index, true) void handlePlayMusic(index, true)
break break
case 'search': case 'search':
handleSearch(index) handleSearch(index)

View File

@ -83,6 +83,7 @@ export default {
if (this.maxPage <= this.btnLength) return Array.from({ length: this.maxPage }, (_, i) => i + 1) if (this.maxPage <= this.btnLength) return Array.from({ length: this.maxPage }, (_, i) => i + 1)
let start = let start =
this.page - this.pageEvg > 1 this.page - this.pageEvg > 1
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
? this.maxPage - this.page < this.pageEvg + 1 ? this.maxPage - this.page < this.pageEvg + 1
? this.maxPage - (this.btnLength - 1) ? this.maxPage - (this.btnLength - 1)
: this.page - this.pageEvg : this.page - this.pageEvg

View File

@ -141,7 +141,7 @@ export default {
}, },
handleSearch() { handleSearch() {
this.hideList() this.hideList()
if (this.selectIndex < 0) return this.sendEvent('submit') if (this.selectIndex < 0) { this.sendEvent('submit'); return }
this.sendEvent('listClick', this.selectIndex) this.sendEvent('listClick', this.selectIndex)
}, },
showList() { showList() {

View File

@ -141,7 +141,7 @@ export const getCachedLyricInfo = async(musicInfo: LX.Music.MusicInfo): Promise<
export const getPlayQuality = (highQuality: boolean, musicInfo: LX.Music.MusicInfoOnline): LX.Quality => { export const getPlayQuality = (highQuality: boolean, musicInfo: LX.Music.MusicInfoOnline): LX.Quality => {
let type: LX.Quality = '128k' let type: LX.Quality = '128k'
let list = qualityList.value[musicInfo.source] let list = qualityList.value[musicInfo.source]
if (highQuality && musicInfo.meta._qualitys['320k'] && list && list.includes('320k')) type = '320k' if (highQuality && musicInfo.meta._qualitys['320k'] && list?.includes('320k')) type = '320k'
return type return type
} }

View File

@ -7,7 +7,7 @@ export const getPlayType = (highQuality: boolean, musicInfo: LX.Music.MusicInfo
if ('progress' in musicInfo || musicInfo.source == 'local') return null if ('progress' in musicInfo || musicInfo.source == 'local') return null
let type: LX.Quality = '128k' let type: LX.Quality = '128k'
let list = qualityList.value[musicInfo.source] let list = qualityList.value[musicInfo.source]
if (highQuality && musicInfo.meta._qualitys['320k'] && list && list.includes('320k')) type = '320k' if (highQuality && musicInfo.meta._qualitys['320k'] && list?.includes('320k')) type = '320k'
return type return type
} }

View File

@ -16,7 +16,7 @@ export default () => {
userApi.status = status userApi.status = status
userApi.message = message userApi.message = message
if (status && apiInfo && apiInfo.sources) { if (status && apiInfo?.sources) {
if (apiInfo.id === appSetting['common.apiSource']) { if (apiInfo.id === appSetting['common.apiSource']) {
let apis: any = {} let apis: any = {}
let qualitys: LX.QualityList = {} let qualitys: LX.QualityList = {}

View File

@ -73,7 +73,7 @@ export default () => {
navigator.mediaSession.playbackState = 'none' navigator.mediaSession.playbackState = 'none'
} }
const handleSetPlayInfo = () => { const handleSetPlayInfo = () => {
emptyAudio.play().finally(() => { void emptyAudio.play().finally(() => {
updateMediaSessionInfo() updateMediaSessionInfo()
updatePositionState({ updatePositionState({
position: playProgress.nowPlayTime, position: playProgress.nowPlayTime,
@ -100,12 +100,12 @@ export default () => {
}) })
navigator.mediaSession.setActionHandler('seekbackward', details => { navigator.mediaSession.setActionHandler('seekbackward', details => {
console.log('seekbackward') console.log('seekbackward')
const seekOffset = details.seekOffset == null ? 5 : details.seekOffset const seekOffset = details.seekOffset ?? 5
setProgress(Math.max(getCurrentTime() - seekOffset, 0)) setProgress(Math.max(getCurrentTime() - seekOffset, 0))
}) })
navigator.mediaSession.setActionHandler('seekforward', details => { navigator.mediaSession.setActionHandler('seekforward', details => {
console.log('seekforward') console.log('seekforward')
const seekOffset = details.seekOffset == null ? 5 : details.seekOffset const seekOffset = details.seekOffset ?? 5
setProgress(Math.min(getCurrentTime() + seekOffset, getDuration())) setProgress(Math.min(getCurrentTime() + seekOffset, getDuration()))
}) })
navigator.mediaSession.setActionHandler('seekto', details => { navigator.mediaSession.setActionHandler('seekto', details => {

View File

@ -1 +0,0 @@
export default LX

View File

@ -143,9 +143,9 @@ export default {
if (task.isComplate) { if (task.isComplate) {
handlePlayMusic(list.value.indexOf(task), true) handlePlayMusic(list.value.indexOf(task), true)
} else if (task.status === downloadStatus.RUN || task.status === downloadStatus.WAITING) { } else if (task.status === downloadStatus.RUN || task.status === downloadStatus.WAITING) {
handlePauseTask(index, true) void handlePauseTask(index, true)
} else { } else {
handleStartTask(index, true) void handleStartTask(index, true)
} }
clickTime = 0 clickTime = 0
clickIndex = -1 clickIndex = -1
@ -172,16 +172,16 @@ export default {
handlePlayMusic(index, true) handlePlayMusic(index, true)
break break
case 'start': case 'start':
handleStartTask(index, true) void handleStartTask(index, true)
break break
case 'pause': case 'pause':
handlePauseTask(index, true) void handlePauseTask(index, true)
break break
case 'remove': case 'remove':
handleRemoveTask(index, true) void handleRemoveTask(index, true)
break break
case 'file': case 'file':
handleOpenFile(index) void handleOpenFile(index)
break break
case 'search': case 'search':
handleSearch(index) handleSearch(index)

View File

@ -25,9 +25,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { watch, shallowReactive, ref } from '@common/utils/vueTools' import { watch, shallowReactive, ref } from '@common/utils/vueTools'
import { getBoardsList, setBoard } from '@renderer/store/leaderboard/action' import { getBoardsList, setBoard } from '@renderer/store/leaderboard/action'
import { boards, Board } from '@renderer/store/leaderboard/state' import { boards, type Board } from '@renderer/store/leaderboard/state'
import useMenu from './useMenu' import useMenu from './useMenu'
import LX from '@renderer/types/lx'
import { useRouter, useRoute } from '@common/utils/vueRouter' import { useRouter, useRoute } from '@common/utils/vueRouter'
const props = defineProps<{ const props = defineProps<{
@ -44,7 +43,7 @@ const list = shallowReactive<Board['list']>([])
const rightClickItemIndex = ref(-1) const rightClickItemIndex = ref(-1)
const handleToggleList = (id: string) => { const handleToggleList = (id: string) => {
router.replace({ void router.replace({
path: route.path, path: route.path,
query: { query: {
source: props.source, source: props.source,
@ -65,7 +64,7 @@ const handleRigthClick = (event: MouseEvent, index: number) => {
rightClickItemIndex.value = index rightClickItemIndex.value = index
showMenu(event, index) showMenu(event, index)
} }
const handleMenuClick = (action?: { action: string}) => { const handleMenuClick = (action?: { action: string }) => {
if (rightClickItemIndex.value < 0) return if (rightClickItemIndex.value < 0) return
let index = rightClickItemIndex.value let index = rightClickItemIndex.value
rightClickItemIndex.value = -1 rightClickItemIndex.value = -1

View File

@ -16,7 +16,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { watch } from '@common/utils/vueTools' import { watch } from '@common/utils/vueTools'
import LX from '@renderer/types/lx'
import useList from './useList' import useList from './useList'

View File

@ -44,7 +44,7 @@ const verifyQueryParams = async function(to, from, next) {
next() next()
source.value = _source source.value = _source
boardId.value = _boardId boardId.value = _boardId
setLeaderboardSetting({ source: _source, boardId: _boardId }) void setLeaderboardSetting({ source: _source, boardId: _boardId })
} }
@ -64,7 +64,7 @@ export default {
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const handleToggleSource = (id) => { const handleToggleSource = (id) => {
router.replace({ void router.replace({
path: route.path, path: route.path,
query: { query: {
source: id, source: id,

View File

@ -139,12 +139,12 @@ export default {
const handleRestoreScroll = (_scrollIndex, _isAnimation) => { const handleRestoreScroll = (_scrollIndex, _isAnimation) => {
scrollIndex = _scrollIndex scrollIndex = _scrollIndex
isAnimation = _isAnimation isAnimation = _isAnimation
if (isAnimation) restoreScroll(scrollIndex, isAnimation) if (isAnimation) void restoreScroll(scrollIndex, isAnimation)
// console.log('handleRestoreScroll', scrollIndex, isAnimation) // console.log('handleRestoreScroll', scrollIndex, isAnimation)
} }
const onLoadedList = () => { const onLoadedList = () => {
// console.log('restoreScroll', scrollIndex, isAnimation) // console.log('restoreScroll', scrollIndex, isAnimation)
restoreScroll(scrollIndex, isAnimation) void restoreScroll(scrollIndex, isAnimation)
} }
const { const {

View File

@ -84,7 +84,7 @@ export default {
watch(() => props.visible, (visible) => { watch(() => props.visible, (visible) => {
if (visible) { if (visible) {
if (duplicateList.value.length) duplicateList.value = [] if (duplicateList.value.length) duplicateList.value = []
handleFilterList() void handleFilterList()
} }
}) })

View File

@ -117,7 +117,7 @@ export default {
console.log(sortType.value, sortField.value) console.log(sortType.value, sortField.value)
closeModal() closeModal()
updateListMusicsPosition({ listId: props.listInfo.id, position: 0, ids: list.map(m => m.id) }) void updateListMusicsPosition({ listId: props.listInfo.id, position: 0, ids: list.map(m => m.id) })
} }
const listName = computed(() => { const listName = computed(() => {

View File

@ -56,7 +56,7 @@ export default {
const updateInfo = ref({}) const updateInfo = ref({})
// const updateTimes = ref({}) // const updateTimes = ref({})
getListUpdateInfo().then((listUpdateInfo) => { void getListUpdateInfo().then((listUpdateInfo) => {
updateInfo.value = listUpdateInfo updateInfo.value = listUpdateInfo
// if (listUpdateTimes._inited) { // if (listUpdateTimes._inited) {
// for (const [id, value] of Object.entries(info)) { // for (const [id, value] of Object.entries(info)) {
@ -72,12 +72,12 @@ export default {
}) })
const handleUpdate = (targetListInfo) => { const handleUpdate = (targetListInfo) => {
handleSyncSourceList(targetListInfo) void handleSyncSourceList(targetListInfo)
// console.log(targetListInfo.list.length, list.length) // console.log(targetListInfo.list.length, list.length)
} }
const handleChangeAutoUpdate = (list, enable) => { const handleChangeAutoUpdate = (list, enable) => {
setListAutoUpdate(list.id, enable) void setListAutoUpdate(list.id, enable)
} }
return { return {

View File

@ -148,16 +148,16 @@ export default {
url = await musicSdk[source].songList.getDetailPageUrl(sourceListId) url = await musicSdk[source].songList.getDetailPageUrl(sourceListId)
} }
if (!url) return if (!url) return
openUrl(url) void openUrl(url)
} }
const handleRemove = (listInfo) => { const handleRemove = (listInfo) => {
dialog.confirm({ void dialog.confirm({
message: t('lists__remove_tip', { name: listInfo.name }), message: t('lists__remove_tip', { name: listInfo.name }),
confirmButtonText: t('lists__remove_tip_button'), confirmButtonText: t('lists__remove_tip_button'),
}).then(isRemove => { }).then(isRemove => {
if (!isRemove) return if (!isRemove) return
removeUserList([listInfo.id]) void removeUserList([listInfo.id])
if (props.listId == listInfo.id) { if (props.listId == listInfo.id) {
handleListToggle(LIST_IDS.DEFAULT) handleListToggle(LIST_IDS.DEFAULT)
} }
@ -212,7 +212,7 @@ export default {
watch(() => userLists, (lists) => { watch(() => userLists, (lists) => {
if (lists.some(l => l.id == props.listId)) return if (lists.some(l => l.id == props.listId)) return
router.replace({ void router.replace({
path: '/list', path: '/list',
query: { query: {
id: defaultList.id, id: defaultList.id,

View File

@ -6,7 +6,7 @@ import useDarg from '@renderer/utils/compositions/useDrag'
export default ({ dom_lists_list, handleSaveListName, handleMenuClick }: { export default ({ dom_lists_list, handleSaveListName, handleMenuClick }: {
dom_lists_list: Ref<HTMLElement | null> dom_lists_list: Ref<HTMLElement | null>
handleSaveListName: () => void handleSaveListName: () => Promise<void> | void
handleMenuClick: () => void handleMenuClick: () => void
}) => { }) => {
const isModDown = ref(false) const isModDown = ref(false)
@ -34,7 +34,7 @@ export default ({ dom_lists_list, handleSaveListName, handleMenuClick }: {
isModDown.value = true isModDown.value = true
setDisabled(false) setDisabled(false)
handleSaveListName() void handleSaveListName()
} }
handleMenuClick() handleMenuClick()
} }

View File

@ -19,7 +19,7 @@
import { watch } from '@common/utils/vueTools' import { watch } from '@common/utils/vueTools'
import { searchText } from '@renderer/store/search/state' import { searchText } from '@renderer/store/search/state'
import { useRouter, useRoute } from '@common/utils/vueRouter' import { useRouter, useRoute } from '@common/utils/vueRouter'
import useList, { SearchSource } from './useList' import useList, { type SearchSource } from './useList'
interface Props { interface Props {
sourceId: SearchSource sourceId: SearchSource
@ -51,7 +51,7 @@ watch(searchText, (searchText) => {
}) })
const handleTogglePage = (page: number) => { const handleTogglePage = (page: number) => {
router.replace({ void router.replace({
path: route.path, path: route.path,
query: { query: {
...route.query, ...route.query,

View File

@ -8,7 +8,7 @@
import { watch } from '@common/utils/vueTools' import { watch } from '@common/utils/vueTools'
import { searchText } from '@renderer/store/search/state' import { searchText } from '@renderer/store/search/state'
import { useRouter, useRoute } from '@common/utils/vueRouter' import { useRouter, useRoute } from '@common/utils/vueRouter'
import useList, { SearchSource } from './useList' import useList, { type SearchSource } from './useList'
import SongList from '@renderer/views/songList/List/components/SongList.vue' import SongList from '@renderer/views/songList/List/components/SongList.vue'
interface Props { interface Props {
@ -40,7 +40,7 @@ watch(searchText, (searchText) => {
}) })
const togglePage = (page: number) => { const togglePage = (page: number) => {
router.replace({ void router.replace({
path: route.path, path: route.path,
query: { query: {
...route.query, ...route.query,

View File

@ -44,7 +44,7 @@ const hotSearchList = shallowRef([])
if (appSetting['search.isShowHotSearch']) { if (appSetting['search.isShowHotSearch']) {
watch(() => props.visible, (visible) => { watch(() => props.visible, (visible) => {
if (!visible) return if (!visible) return
getList(props.source).then(list => { void getList(props.source).then(list => {
hotSearchList.value = list hotSearchList.value = list
}) })
}, { }, {
@ -53,7 +53,7 @@ if (appSetting['search.isShowHotSearch']) {
watch(() => props.source, (source) => { watch(() => props.source, (source) => {
if (!props.visible) return if (!props.visible) return
getList(source).then(list => { void getList(source).then(list => {
if (source != props.source) return if (source != props.source) return
hotSearchList.value = list hotSearchList.value = list
}) })
@ -61,12 +61,12 @@ if (appSetting['search.isShowHotSearch']) {
} }
if (appSetting['search.isShowHistorySearch']) { if (appSetting['search.isShowHistorySearch']) {
getHistoryList() void getHistoryList()
} }
const router = useRouter() const router = useRouter()
const handleSearch = (text) => { const handleSearch = (text) => {
router.replace({ void router.replace({
path: '/search', path: '/search',
query: { query: {
text, text,

View File

@ -54,7 +54,7 @@ const verifyQueryParams = async(to, from, next) => {
if (!_page) page.value = 1 if (!_page) page.value = 1
} }
next() next()
setSearchSetting({ source: _source, type: _type }) void setSearchSetting({ source: _source, type: _type })
} }
export default { export default {
@ -76,7 +76,7 @@ export default {
} }
}) })
const handleSourceChange = (id) => { const handleSourceChange = (id) => {
router.replace({ void router.replace({
path: route.path, path: route.path,
query: { query: {
...route.query, ...route.query,
@ -93,7 +93,7 @@ export default {
] ]
}) })
const handleTypeChange = (type) => { const handleTypeChange = (type) => {
router.replace({ void router.replace({
path: route.path, path: route.path,
query: { query: {
...route.query, ...route.query,

View File

@ -148,11 +148,11 @@ export default {
await importNewListData(allData.playList) await importNewListData(allData.playList)
importNewSettingData(allData.setting) importNewSettingData(allData.setting)
break break
default: return showImportTip(allData.type) default: { showImportTip(allData.type) }
} }
} }
const handleImportAllData = () => { const handleImportAllData = () => {
showSelectDialog({ void showSelectDialog({
title: t('setting__backup_all_import_desc'), title: t('setting__backup_all_import_desc'),
properties: ['openFile'], properties: ['openFile'],
filters: [ filters: [
@ -161,13 +161,13 @@ export default {
], ],
}).then(result => { }).then(result => {
if (result.canceled) return if (result.canceled) return
dialog.confirm({ void dialog.confirm({
message: t('setting__backup_part_import_list_confirm'), message: t('setting__backup_part_import_list_confirm'),
cancelButtonText: t('cancel_button_text'), cancelButtonText: t('cancel_button_text'),
confirmButtonText: t('confirm_button_text'), confirmButtonText: t('confirm_button_text'),
}).then(confirm => { }).then(confirm => {
if (!confirm) return if (!confirm) return
importAllData(result.filePaths[0]) void importAllData(result.filePaths[0])
}) })
}) })
} }
@ -178,15 +178,15 @@ export default {
setting: { ...appSetting }, setting: { ...appSetting },
playList: await getAllLists(), playList: await getAllLists(),
} }
window.lx.worker.main.saveLxConfigFile(path, allData) void window.lx.worker.main.saveLxConfigFile(path, allData)
} }
const handleExportAllData = () => { const handleExportAllData = () => {
openSaveDir({ void openSaveDir({
title: t('setting__backup_all_export_desc'), title: t('setting__backup_all_export_desc'),
defaultPath: 'lx_datas_v2.lxmc', defaultPath: 'lx_datas_v2.lxmc',
}).then(result => { }).then(result => {
if (result.canceled) return if (result.canceled) return
exportAllData(result.filePath) void exportAllData(result.filePath)
}) })
} }
@ -195,10 +195,10 @@ export default {
type: 'setting_v2', type: 'setting_v2',
data: { ...appSetting }, data: { ...appSetting },
} }
window.lx.worker.main.saveLxConfigFile(path, data) void window.lx.worker.main.saveLxConfigFile(path, data)
} }
const handleExportSetting = () => { const handleExportSetting = () => {
openSaveDir({ void openSaveDir({
title: t('setting__backup_part_export_setting_desc'), title: t('setting__backup_part_export_setting_desc'),
defaultPath: 'lx_setting_v2.lxmc', defaultPath: 'lx_setting_v2.lxmc',
}).then(result => { }).then(result => {
@ -222,11 +222,11 @@ export default {
case 'setting_v2': case 'setting_v2':
importNewSettingData(settingData.data) importNewSettingData(settingData.data)
break break
default: return showImportTip(settingData.type) default: { showImportTip(settingData.type) }
} }
} }
const handleImportSetting = () => { const handleImportSetting = () => {
showSelectDialog({ void showSelectDialog({
title: t('setting__backup_part_import_setting_desc'), title: t('setting__backup_part_import_setting_desc'),
properties: ['openFile'], properties: ['openFile'],
filters: [ filters: [
@ -235,7 +235,7 @@ export default {
], ],
}).then(result => { }).then(result => {
if (result.canceled) return if (result.canceled) return
importSetting(result.filePaths[0]) void importSetting(result.filePaths[0])
}) })
} }
@ -244,15 +244,15 @@ export default {
type: 'playList_v2', type: 'playList_v2',
data: await getAllLists(), data: await getAllLists(),
} }
window.lx.worker.main.saveLxConfigFile(path, data) void window.lx.worker.main.saveLxConfigFile(path, data)
} }
const handleExportPlayList = () => { const handleExportPlayList = () => {
openSaveDir({ void openSaveDir({
title: t('setting__backup_part_export_list_desc'), title: t('setting__backup_part_export_list_desc'),
defaultPath: 'lx_list.lxmc', defaultPath: 'lx_list.lxmc',
}).then(result => { }).then(result => {
if (result.canceled) return if (result.canceled) return
exportPlayList(result.filePath) void exportPlayList(result.filePath)
}) })
} }
@ -275,11 +275,11 @@ export default {
case 'playList_v2': case 'playList_v2':
await importNewListData(listData.data) await importNewListData(listData.data)
break break
default: return showImportTip(listData.type) default: { showImportTip(listData.type) }
} }
} }
const handleImportPlayList = () => { const handleImportPlayList = () => {
showSelectDialog({ void showSelectDialog({
title: t('setting__backup_part_import_list_desc'), title: t('setting__backup_part_import_list_desc'),
properties: ['openFile'], properties: ['openFile'],
filters: [ filters: [
@ -288,13 +288,13 @@ export default {
], ],
}).then(result => { }).then(result => {
if (result.canceled) return if (result.canceled) return
dialog.confirm({ void dialog.confirm({
message: t('setting__backup_part_import_list_confirm'), message: t('setting__backup_part_import_list_confirm'),
cancelButtonText: t('cancel_button_text'), cancelButtonText: t('cancel_button_text'),
confirmButtonText: t('confirm_button_text'), confirmButtonText: t('confirm_button_text'),
}).then(confirm => { }).then(confirm => {
if (!confirm) return if (!confirm) return
importPlayList(result.filePaths[0]) void importPlayList(result.filePaths[0])
}) })
}) })
} }
@ -310,23 +310,23 @@ export default {
confirmButtonText: t('confirm_button_text'), confirmButtonText: t('confirm_button_text'),
}) })
if (confirm) { if (confirm) {
openSaveDir({ void openSaveDir({
title: t('setting__backup_other_export_dir'), title: t('setting__backup_other_export_dir'),
defaultPath: 'lx_list_all.txt', defaultPath: 'lx_list_all.txt',
}).then(result => { }).then(result => {
if (result.canceled) return if (result.canceled) return
let path = result.filePath let path = result.filePath
if (!path.endsWith('.txt')) path += '.txt' if (!path.endsWith('.txt')) path += '.txt'
exportPlayListToText(path, true) void exportPlayListToText(path, true)
}) })
} else { } else {
showSelectDialog({ void showSelectDialog({
title: t('setting__backup_other_export_dir'), title: t('setting__backup_other_export_dir'),
// defaultPath: currentStting.value.download.savePath, // defaultPath: currentStting.value.download.savePath,
properties: ['openDirectory'], properties: ['openDirectory'],
}).then(result => { }).then(result => {
if (result.canceled) return if (result.canceled) return
exportPlayListToText(result.filePaths[0], false) void exportPlayListToText(result.filePaths[0], false)
}) })
} }
} }
@ -342,23 +342,23 @@ export default {
confirmButtonText: t('confirm_button_text'), confirmButtonText: t('confirm_button_text'),
}) })
if (confirm) { if (confirm) {
openSaveDir({ void openSaveDir({
title: t('setting__backup_other_export_dir'), title: t('setting__backup_other_export_dir'),
defaultPath: 'lx_list_all.csv', defaultPath: 'lx_list_all.csv',
}).then(result => { }).then(result => {
if (result.canceled) return if (result.canceled) return
let path = result.filePath let path = result.filePath
if (!path.endsWith('.csv')) path += '.csv' if (!path.endsWith('.csv')) path += '.csv'
exportPlayListToCsv(path, true) void exportPlayListToCsv(path, true)
}) })
} else { } else {
showSelectDialog({ void showSelectDialog({
title: t('setting__backup_other_export_dir'), title: t('setting__backup_other_export_dir'),
// defaultPath: currentStting.value.download.savePath, // defaultPath: currentStting.value.download.savePath,
properties: ['openDirectory'], properties: ['openDirectory'],
}).then(result => { }).then(result => {
if (result.canceled) return if (result.canceled) return
exportPlayListToCsv(result.filePaths[0], false) void exportPlayListToCsv(result.filePaths[0], false)
}) })
} }
} }

View File

@ -186,7 +186,7 @@ export default {
const handleEditTheme = (theme) => { const handleEditTheme = (theme) => {
// console.log(theme) // console.log(theme)
if (!theme && userThemes.length >= 10) { if (!theme && userThemes.length >= 10) {
dialog({ void dialog({
message: t('theme_max_tip'), message: t('theme_max_tip'),
confirmButtonText: t('alert_button_text'), confirmButtonText: t('alert_button_text'),
}) })
@ -214,7 +214,7 @@ export default {
if (themeId.value == 'auto') return if (themeId.value == 'auto') return
if (window.localStorage.getItem('theme-auto-tip') != 'true') { if (window.localStorage.getItem('theme-auto-tip') != 'true') {
window.localStorage.setItem('theme-auto-tip', 'true') window.localStorage.setItem('theme-auto-tip', 'true')
dialog({ void dialog({
message: t('setting__basic_theme_auto_tip'), message: t('setting__basic_theme_auto_tip'),
confirmButtonText: t('ok'), confirmButtonText: t('ok'),
}) })
@ -271,7 +271,7 @@ export default {
const fontList = computed(() => { const fontList = computed(() => {
return [{ id: '', label: t('setting__desktop_lyric_font_default') }, ...systemFontList.value] return [{ id: '', label: t('setting__desktop_lyric_font_default') }, ...systemFontList.value]
}) })
getSystemFonts().then(fonts => { void getSystemFonts().then(fonts => {
systemFontList.value = fonts.map(f => ({ id: f, label: f.replace(/(^"|"$)/g, '') })) systemFontList.value = fonts.map(f => ({ id: f, label: f.replace(/(^"|"$)/g, '') }))
}) })

View File

@ -269,7 +269,7 @@ export default {
const fontList = computed(() => { const fontList = computed(() => {
return [{ id: '', label: t('setting__desktop_lyric_font_default') }, ...systemFontList.value] return [{ id: '', label: t('setting__desktop_lyric_font_default') }, ...systemFontList.value]
}) })
getSystemFonts().then(fonts => { void getSystemFonts().then(fonts => {
systemFontList.value = fonts.map(f => ({ id: f, label: f.replace(/(^"|"$)/g, '') })) systemFontList.value = fonts.map(f => ({ id: f, label: f.replace(/(^"|"$)/g, '') }))
}) })

View File

@ -67,7 +67,7 @@ export default {
const t = useI18n() const t = useI18n()
const handleChangeSavePath = () => { const handleChangeSavePath = () => {
showSelectDialog({ void showSelectDialog({
title: t('setting__download_select_save_path'), title: t('setting__download_select_save_path'),
defaultPath: appSetting['download.savePath'], defaultPath: appSetting['download.savePath'],
properties: ['openDirectory'], properties: ['openDirectory'],

View File

@ -134,6 +134,7 @@ export default {
if (config) { if (config) {
if (config.key == newHotKey) return if (config.key == newHotKey) return
originKey = config.key originKey = config.key
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete current_hot_key.value[type].keys[config.key] delete current_hot_key.value[type].keys[config.key]
} else if (!newHotKey) return } else if (!newHotKey) return
@ -143,6 +144,7 @@ export default {
config = tempInfo.keys[newHotKey] config = tempInfo.keys[newHotKey]
if (config) { if (config) {
console.log(newHotKey, info, config, info.name, config.name) console.log(newHotKey, info, config, info.name, config.name)
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete current_hot_key.value[tempType].keys[newHotKey] delete current_hot_key.value[tempType].keys[newHotKey]
break break
} }
@ -203,7 +205,7 @@ export default {
await handleHotKeySaveConfig() await handleHotKeySaveConfig()
await getHotKeyStatus() await getHotKeyStatus()
} }
const getHotKeyStatus = () => { const getHotKeyStatus = async() => {
return hotKeyGetStatus().then(status => { return hotKeyGetStatus().then(status => {
// console.log(status) // console.log(status)
hotKeyStatus.value = status hotKeyStatus.value = status
@ -213,7 +215,7 @@ export default {
current_hot_key.value = window.lx.appHotKeyConfig current_hot_key.value = window.lx.appHotKeyConfig
initHotKeyConfig() initHotKeyConfig()
getHotKeyStatus() void getHotKeyStatus()
window.app_event.on('keyDown', handleKeyDown) window.app_event.on('keyDown', handleKeyDown)

View File

@ -83,7 +83,7 @@ export default {
const isDisabledResourceCacheClear = ref(false) const isDisabledResourceCacheClear = ref(false)
// const isDisabledListCacheClear = ref(false) // const isDisabledListCacheClear = ref(false)
const refreshCacheSize = () => { const refreshCacheSize = () => {
getCacheSize().then(size => { void getCacheSize().then(size => {
cacheSize.value = sizeFormate(size) cacheSize.value = sizeFormate(size)
}) })
} }
@ -94,7 +94,7 @@ export default {
confirmButtonText: t('setting__other_resource_cache_confirm'), confirmButtonText: t('setting__other_resource_cache_confirm'),
})) return })) return
isDisabledResourceCacheClear.value = true isDisabledResourceCacheClear.value = true
clearCache().then(() => { void clearCache().then(() => {
refreshCacheSize() refreshCacheSize()
isDisabledResourceCacheClear.value = false isDisabledResourceCacheClear.value = false
}) })
@ -105,13 +105,13 @@ export default {
const otherSourceCount = ref(0) const otherSourceCount = ref(0)
const isDisabledOtherSourceCacheClear = ref(false) const isDisabledOtherSourceCacheClear = ref(false)
const refreshOtherSourceCount = () => { const refreshOtherSourceCount = () => {
getOtherSourceCount().then(count => { void getOtherSourceCount().then(count => {
otherSourceCount.value = count otherSourceCount.value = count
}) })
} }
const handleClearOtherSourceCache = async() => { const handleClearOtherSourceCache = async() => {
isDisabledOtherSourceCacheClear.value = true isDisabledOtherSourceCacheClear.value = true
clearOtherSource().then(() => { void clearOtherSource().then(() => {
refreshOtherSourceCount() refreshOtherSourceCount()
isDisabledOtherSourceCacheClear.value = false isDisabledOtherSourceCacheClear.value = false
}) })
@ -122,13 +122,13 @@ export default {
const musicUrlCount = ref(0) const musicUrlCount = ref(0)
const isDisabledMusicUrlCacheClear = ref(false) const isDisabledMusicUrlCacheClear = ref(false)
const refreshMusicUrlCount = () => { const refreshMusicUrlCount = () => {
getMusicUrlCount().then(count => { void getMusicUrlCount().then(count => {
musicUrlCount.value = count musicUrlCount.value = count
}) })
} }
const handleClearMusicUrlCache = async() => { const handleClearMusicUrlCache = async() => {
isDisabledMusicUrlCacheClear.value = true isDisabledMusicUrlCacheClear.value = true
clearMusicUrl().then(() => { void clearMusicUrl().then(() => {
refreshMusicUrlCount() refreshMusicUrlCount()
isDisabledMusicUrlCacheClear.value = false isDisabledMusicUrlCacheClear.value = false
}) })
@ -139,13 +139,13 @@ export default {
const lyricRawCount = ref(0) const lyricRawCount = ref(0)
const isDisabledLyricRawCacheClear = ref(false) const isDisabledLyricRawCacheClear = ref(false)
const refreshLyricRawCount = () => { const refreshLyricRawCount = () => {
getLyricRawCount().then(count => { void getLyricRawCount().then(count => {
lyricRawCount.value = count lyricRawCount.value = count
}) })
} }
const handleClearLyricRawCache = async() => { const handleClearLyricRawCache = async() => {
isDisabledLyricRawCacheClear.value = true isDisabledLyricRawCacheClear.value = true
clearLyricRaw().then(() => { void clearLyricRaw().then(() => {
refreshLyricRawCount() refreshLyricRawCount()
isDisabledLyricRawCacheClear.value = false isDisabledLyricRawCacheClear.value = false
}) })
@ -156,7 +156,7 @@ export default {
const lyricEditedCount = ref(0) const lyricEditedCount = ref(0)
const isDisabledLyricEditedCacheClear = ref(false) const isDisabledLyricEditedCacheClear = ref(false)
const refreshLyricEditedCount = () => { const refreshLyricEditedCount = () => {
getLyricEditedCount().then(count => { void getLyricEditedCount().then(count => {
lyricEditedCount.value = count lyricEditedCount.value = count
}) })
} }
@ -167,7 +167,7 @@ export default {
confirmButtonText: t('setting__other_resource_cache_confirm'), confirmButtonText: t('setting__other_resource_cache_confirm'),
})) return })) return
isDisabledLyricEditedCacheClear.value = true isDisabledLyricEditedCacheClear.value = true
clearLyricEdited().then(() => { void clearLyricEdited().then(() => {
refreshLyricEditedCount() refreshLyricEditedCount()
isDisabledLyricEditedCacheClear.value = false isDisabledLyricEditedCacheClear.value = false
}) })
@ -180,7 +180,7 @@ export default {
cancelButtonText: t('cancel_button_text'), cancelButtonText: t('cancel_button_text'),
confirmButtonText: t('setting__other_resource_cache_confirm'), confirmButtonText: t('setting__other_resource_cache_confirm'),
})) return })) return
overwriteListFull({ void overwriteListFull({
defaultList: [], defaultList: [],
loveList: [], loveList: [],
userList: [], userList: [],

View File

@ -47,7 +47,7 @@ export default {
mediaDevices.value = audioDevices mediaDevices.value = audioDevices
// console.log(this.mediaDevices) // console.log(this.mediaDevices)
} }
getMediaDevice() void getMediaDevice()
navigator.mediaDevices.addEventListener('devicechange', getMediaDevice) navigator.mediaDevices.addEventListener('devicechange', getMediaDevice)
onBeforeUnmount(() => { onBeforeUnmount(() => {

View File

@ -91,7 +91,7 @@ export default {
}) })
const refreshSyncCode = () => { const refreshSyncCode = () => {
sendSyncAction({ action: 'generate_code' }) void sendSyncAction({ action: 'generate_code' })
} }
const setSyncServerPort = debounce(port => { const setSyncServerPort = debounce(port => {

View File

@ -288,39 +288,39 @@ export default {
// console.log('appBgColor', color) // console.log('appBgColor', color)
theme.config.extInfo['--color-app-background'] = color == appBgColor ? appBgColorOrigin : color theme.config.extInfo['--color-app-background'] = color == appBgColor ? appBgColorOrigin : color
createPreview() createPreview()
}, () => setAppBgColor(getColor(appBgColorOrigin, theme))) }, () => { setAppBgColor(getColor(appBgColorOrigin, theme)) })
initAsideFontColor(asideFontColor, (color) => { initAsideFontColor(asideFontColor, (color) => {
theme.config.extInfo['--color-nav-font'] = color == asideFontColor ? asideFontColorOrigin : color theme.config.extInfo['--color-nav-font'] = color == asideFontColor ? asideFontColorOrigin : color
createPreview() createPreview()
}, () => setAsideFontColor(getColor(asideFontColorOrigin, theme))) }, () => { setAsideFontColor(getColor(asideFontColorOrigin, theme)) })
initMainBgColor(mainBgColor, (color) => { initMainBgColor(mainBgColor, (color) => {
theme.config.extInfo['--color-main-background'] = color == mainBgColor ? mainBgColorOrigin : color theme.config.extInfo['--color-main-background'] = color == mainBgColor ? mainBgColorOrigin : color
createPreview() createPreview()
}, () => setMainBgColor(getColor(mainBgColorOrigin, theme))) }, () => { setMainBgColor(getColor(mainBgColorOrigin, theme)) })
initBadgePrimaryColor(badgePrimaryColor, (color) => { initBadgePrimaryColor(badgePrimaryColor, (color) => {
theme.config.extInfo['--color-badge-primary'] = color == badgePrimaryColor ? badgePrimaryColorOrigin : color theme.config.extInfo['--color-badge-primary'] = color == badgePrimaryColor ? badgePrimaryColorOrigin : color
createPreview() createPreview()
}, () => setBadgePrimaryColor(getColor(badgePrimaryColorOrigin, theme))) }, () => { setBadgePrimaryColor(getColor(badgePrimaryColorOrigin, theme)) })
initBadgeSecondaryColor(badgeSecondaryColor, (color) => { initBadgeSecondaryColor(badgeSecondaryColor, (color) => {
theme.config.extInfo['--color-badge-secondary'] = color == badgeSecondaryColor ? badgeSecondaryColorOrigin : color theme.config.extInfo['--color-badge-secondary'] = color == badgeSecondaryColor ? badgeSecondaryColorOrigin : color
createPreview() createPreview()
}, () => setBadgeSecondaryColor(getColor(badgeSecondaryColorOrigin, theme))) }, () => { setBadgeSecondaryColor(getColor(badgeSecondaryColorOrigin, theme)) })
initBadgeTertiaryColor(badgeTertiaryColor, (color) => { initBadgeTertiaryColor(badgeTertiaryColor, (color) => {
theme.config.extInfo['--color-badge-tertiary'] = color == badgeTertiaryColor ? badgeTertiaryColorOrigin : color theme.config.extInfo['--color-badge-tertiary'] = color == badgeTertiaryColor ? badgeTertiaryColorOrigin : color
createPreview() createPreview()
}, () => setBadgeTertiaryColor(getColor(badgeTertiaryColorOrigin, theme))) }, () => { setBadgeTertiaryColor(getColor(badgeTertiaryColorOrigin, theme)) })
initCloseBtnColor(closeBtnColor, (color) => { initCloseBtnColor(closeBtnColor, (color) => {
theme.config.extInfo['--color-btn-close'] = color == closeBtnColor ? closeBtnColorOrigin : color theme.config.extInfo['--color-btn-close'] = color == closeBtnColor ? closeBtnColorOrigin : color
createPreview() createPreview()
}, () => setCloseBtnColor(getColor(closeBtnColorOrigin, theme))) }, () => { setCloseBtnColor(getColor(closeBtnColorOrigin, theme)) })
initMinBtnColor(minBtnColor, (color) => { initMinBtnColor(minBtnColor, (color) => {
theme.config.extInfo['--color-btn-min'] = color == minBtnColor ? minBtnColorOrigin : color theme.config.extInfo['--color-btn-min'] = color == minBtnColor ? minBtnColorOrigin : color
createPreview() createPreview()
}, () => setMinBtnColor(getColor(minBtnColorOrigin, theme))) }, () => { setMinBtnColor(getColor(minBtnColorOrigin, theme)) })
initHideBtnColor(hideBtnColor, (color) => { initHideBtnColor(hideBtnColor, (color) => {
theme.config.extInfo['--color-btn-hide'] = color == hideBtnColor ? hideBtnColorOrigin : color theme.config.extInfo['--color-btn-hide'] = color == hideBtnColor ? hideBtnColorOrigin : color
createPreview() createPreview()
}, () => setHideBtnColor(getColor(hideBtnColorOrigin, theme))) }, () => { setHideBtnColor(getColor(hideBtnColorOrigin, theme)) })
createPreview() createPreview()
} }
@ -339,7 +339,7 @@ export default {
} }
watch(() => props.modelValue, (visible) => { watch(() => props.modelValue, (visible) => {
nextTick(() => { void nextTick(() => {
getThemes(({ themes, userThemes }) => { getThemes(({ themes, userThemes }) => {
if (visible) { if (visible) {
if (props.themeId) { if (props.themeId) {
@ -392,7 +392,7 @@ export default {
} }
const removeBgImg = async() => { const removeBgImg = async() => {
if (currentBgPath) { if (currentBgPath) {
removeFile(currentBgPath) void removeFile(currentBgPath)
currentBgPath = '' currentBgPath = ''
} }
bgImg.value = '' bgImg.value = ''
@ -432,7 +432,7 @@ export default {
// //
if (originBgName && if (originBgName &&
theme.config.extInfo['--background-image'] != originBgName && theme.config.extInfo['--background-image'] != originBgName &&
!isUrl(theme.config.extInfo['--background-image'])) removeFile(joinPath(themeInfo.dataPath, originBgName)) !isUrl(theme.config.extInfo['--background-image'])) void removeFile(joinPath(themeInfo.dataPath, originBgName))
if (props.themeId) { if (props.themeId) {
const index = themeInfo.userThemes.findIndex(t => t.id == theme.id) const index = themeInfo.userThemes.findIndex(t => t.id == theme.id)
if (index > -1) themeInfo.userThemes.splice(index, 1, theme) if (index > -1) themeInfo.userThemes.splice(index, 1, theme)
@ -468,7 +468,7 @@ export default {
} }
} }
if (isRequireUpdateSetting) updateSetting(newSetting) if (isRequireUpdateSetting) updateSetting(newSetting)
if (originBgName) removeFile(joinPath(themeInfo.dataPath, originBgName)) if (originBgName) void removeFile(joinPath(themeInfo.dataPath, originBgName))
await removeTheme(props.themeId) await removeTheme(props.themeId)
const index = themeInfo.userThemes.findIndex(t => t.id == theme.id) const index = themeInfo.userThemes.findIndex(t => t.id == theme.id)
console.log(index) console.log(index)

View File

@ -60,16 +60,16 @@ export default {
}) })
return return
} }
showSelectDialog({ void showSelectDialog({
title: this.$t('user_api__import_file'), title: this.$t('user_api__import_file'),
properties: ['openFile'], properties: ['openFile'],
filters: [ filters: [
{ name: 'LX API File', extensions: ['js'] }, { name: 'LX API File', extensions: ['js'] },
{ name: 'All Files', extensions: ['*'] }, { name: 'All Files', extensions: ['*'] },
], ],
}).then(result => { }).then(async result => {
if (result.canceled) return if (result.canceled) return
return readFile(result.filePaths[0]).then(data => { return readFile(result.filePaths[0]).then(async data => {
return importUserApi(data.toString()).then(({ apiList }) => { return importUserApi(data.toString()).then(({ apiList }) => {
userApi.list = apiList userApi.list = apiList
}) })
@ -92,10 +92,10 @@ export default {
this.$emit('update:modelValue', false) this.$emit('update:modelValue', false)
}, },
handleOpenUrl(url) { handleOpenUrl(url) {
openUrl(url) void openUrl(url)
}, },
handleChangeAllowUpdateAlert(api, enable) { handleChangeAllowUpdateAlert(api, enable) {
setAllowShowUserApiUpdateAlert(api.id, enable) void setAllowShowUserApiUpdateAlert(api.id, enable)
}, },
}, },
} }

View File

@ -119,7 +119,7 @@ export default {
const toggleTab = id => { const toggleTab = id => {
avtiveComponentName.value = id avtiveComponentName.value = id
nextTick(() => { void nextTick(() => {
dom_content_ref.value?.scrollTo({ dom_content_ref.value?.scrollTo({
top: 0, top: 0,
behavior: 'smooth', behavior: 'smooth',

View File

@ -45,7 +45,6 @@
import { ref, watch } from '@common/utils/vueTools' import { ref, watch } from '@common/utils/vueTools'
import { listDetailInfo } from '@renderer/store/songList/state' import { listDetailInfo } from '@renderer/store/songList/state'
import { setVisibleListDetail } from '@renderer/store/songList/action' import { setVisibleListDetail } from '@renderer/store/songList/action'
import LX from '@renderer/types/lx'
import { useRouter } from '@common/utils/vueRouter' import { useRouter } from '@common/utils/vueRouter'
import { addSongListDetail, playSongListDetail } from './action' import { addSongListDetail, playSongListDetail } from './action'
import useList from './useList' import useList from './useList'
@ -68,7 +67,7 @@ interface Query {
fromName?: string fromName?: string
} }
const verifyQueryParams = async function(this: any, to: { query: Query, path: string}, from: any, next: (route?: { path: string; query: Query }) => void) { const verifyQueryParams = async function(this: any, to: { query: Query, path: string }, from: any, next: (route?: { path: string, query: Query }) => void) {
let _source = to.query.source let _source = to.query.source
let _id = to.query.id let _id = to.query.id
let _page: string | undefined = to.query.page let _page: string | undefined = to.query.page
@ -119,25 +118,25 @@ export default {
const togglePage = (page: number) => { const togglePage = (page: number) => {
getListData(source.value, id.value, page, refresh.value) void getListData(source.value, id.value, page, refresh.value)
} }
const handleBack = () => { const handleBack = () => {
setVisibleListDetail(false) setVisibleListDetail(false)
if (window.lx.songListInfo.fromName) router.replace({ name: window.lx.songListInfo.fromName }) if (window.lx.songListInfo.fromName) void router.replace({ name: window.lx.songListInfo.fromName })
else router.back() else router.back()
} }
useKeyBack(handleBack) useKeyBack(handleBack)
watch([source, id, page, refresh], ([_source, _id, _page, _refresh]) => { watch([source, id, page, refresh], async([_source, _id, _page, _refresh]) => {
if (!_source || !_id) return router.replace({ path: '/songList/list' }) if (!_source || !_id) return router.replace({ path: '/songList/list' })
// console.log(_source, _id, _page, _refresh, picUrl.value) // console.log(_source, _id, _page, _refresh, picUrl.value)
// source.value = _source // source.value = _source
// id.value = _id // id.value = _id
// refresh.value = _refresh // refresh.value = _refresh
// page.value = _page ?? 1 // page.value = _page ?? 1
getListData(_source, _id, _page, _refresh) void getListData(_source, _id, _page, _refresh)
}, { }, {
immediate: true, immediate: true,
}) })

View File

@ -7,7 +7,6 @@ import { watch, ref, nextTick } from '@common/utils/vueTools'
import { listInfo } from '@renderer/store/songList/state' import { listInfo } from '@renderer/store/songList/state'
import { getAndSetList } from '@renderer/store/songList/action' import { getAndSetList } from '@renderer/store/songList/action'
import { useRouter, useRoute, onBeforeRouteLeave } from '@common/utils/vueRouter' import { useRouter, useRoute, onBeforeRouteLeave } from '@common/utils/vueRouter'
import LX from '@renderer/types/lx'
import SongList from './components/SongList.vue' import SongList from './components/SongList.vue'
@ -28,12 +27,12 @@ const getListData = async(source: LX.OnlineSource, tabId: string, sortId: string
// console.log(source, tabId, sortId, page) // console.log(source, tabId, sortId, page)
await getAndSetList(source, tabId, sortId, page).then(() => { await getAndSetList(source, tabId, sortId, page).then(() => {
if (listInfo.key == window.lx.songListInfo.songlistKey && window.lx.songListInfo.songlistPosition) { if (listInfo.key == window.lx.songListInfo.songlistKey && window.lx.songListInfo.songlistPosition) {
nextTick(() => { void nextTick(() => {
list_ref.value?.scrollTo(window.lx.songListInfo.songlistPosition) list_ref.value?.scrollTo(window.lx.songListInfo.songlistPosition)
}) })
} else if (list_ref.value) { } else if (list_ref.value) {
window.lx.songListInfo.songlistKey = null window.lx.songListInfo.songlistKey = null
nextTick(() => { void nextTick(() => {
list_ref.value.scrollTo(0) list_ref.value.scrollTo(0)
}) })
} }
@ -41,7 +40,7 @@ const getListData = async(source: LX.OnlineSource, tabId: string, sortId: string
} }
const togglePage = (page: number) => { const togglePage = (page: number) => {
router.replace({ void router.replace({
path: route.path, path: route.path,
query: { query: {
...route.query, ...route.query,
@ -57,7 +56,7 @@ watch(() => [props.source, props.tagId, props.sortId, props.page], ([source, tag
// console.log(source, tagId, sortId) // console.log(source, tagId, sortId)
if (!source || !sortId) return if (!source || !sortId) return
// console.log(source, tagId, sortId, page) // console.log(source, tagId, sortId, page)
getListData(source as LX.OnlineSource, tagId as string, sortId as string, page as number) void getListData(source as LX.OnlineSource, tagId as string, sortId as string, page as number)
}, { }, {
immediate: true, immediate: true,
}) })

View File

@ -65,7 +65,7 @@ watch(() => props.modelValue, (visible) => {
const handleSubmit = () => { const handleSubmit = () => {
if (!text.value.length) return if (!text.value.length) return
setOpenSongListInputInfo(text.value, source.value) setOpenSongListInputInfo(text.value, source.value)
router.push({ void router.push({
path: '/songList/detail', path: '/songList/detail',
query: { query: {
source: source.value, source: source.value,

View File

@ -36,7 +36,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from '@common/utils/vueTools' import { ref } from '@common/utils/vueTools'
import type { ListInfo, ListInfoItem } from '@renderer/store/songList/state' import type { ListInfo, ListInfoItem } from '@renderer/store/songList/state'
// import LX from '@renderer/types/lx'
import { useRoute, useRouter } from '@common/utils/vueRouter' import { useRoute, useRouter } from '@common/utils/vueRouter'
@ -60,7 +59,7 @@ const togglePage = (page: number) => {
} }
const toDetail = (info: ListInfoItem) => { const toDetail = (info: ListInfoItem) => {
router.push({ void router.push({
path: '/songList/detail', path: '/songList/detail',
query: { query: {
source: info.source, source: info.source,

View File

@ -29,7 +29,7 @@ const list = shallowReactive([])
const handleToggle = (id) => { const handleToggle = (id) => {
router.replace({ void router.replace({
path: route.path, path: route.path,
query: { query: {
source: props.source, source: props.source,

View File

@ -24,7 +24,6 @@
import { watch, shallowReactive, ref, onMounted, onBeforeUnmount, computed, reactive } from '@common/utils/vueTools' import { watch, shallowReactive, ref, onMounted, onBeforeUnmount, computed, reactive } from '@common/utils/vueTools'
import { setTags, getTags } from '@renderer/store/songList/action' import { setTags, getTags } from '@renderer/store/songList/action'
import { tags, type TagInfoTypeItem } from '@renderer/store/songList/state' import { tags, type TagInfoTypeItem } from '@renderer/store/songList/state'
import LX from '@renderer/types/lx'
import { useRouter, useRoute } from '@common/utils/vueRouter' import { useRouter, useRoute } from '@common/utils/vueRouter'
import { useI18n } from '@renderer/plugins/i18n' import { useI18n } from '@renderer/plugins/i18n'
@ -40,7 +39,7 @@ const t = useI18n()
const list = shallowReactive<TagInfoTypeItem[]>([]) const list = shallowReactive<TagInfoTypeItem[]>([])
const handleToggleTag = (id: string) => { const handleToggleTag = (id: string) => {
router.replace({ void router.replace({
path: route.path, path: route.path,
query: { query: {
source: props.source, source: props.source,

View File

@ -22,7 +22,6 @@ import OpenListModal from './components/OpenListModal.vue'
import ListView from './ListView.vue' import ListView from './ListView.vue'
import { sources, listInfo, isVisibleListDetail } from '@renderer/store/songList/state' import { sources, listInfo, isVisibleListDetail } from '@renderer/store/songList/state'
import { sourceNames } from '@renderer/store' import { sourceNames } from '@renderer/store'
import LX from '@renderer/types/lx'
import { useRoute, useRouter } from '@common/utils/vueRouter' import { useRoute, useRouter } from '@common/utils/vueRouter'
const source = ref<LX.OnlineSource>('kw') const source = ref<LX.OnlineSource>('kw')
@ -38,7 +37,7 @@ interface Query {
page?: string page?: string
} }
const verifyQueryParams = async function(this: any, to: { query: Query, path: string}, from: any, next: (route?: { path: string; query: Query }) => void) { const verifyQueryParams = async function(this: any, to: { query: Query, path: string }, from: any, next: (route?: { path: string, query: Query }) => void) {
let _source = to.query.source let _source = to.query.source
let _tagId = to.query.tagId let _tagId = to.query.tagId
let _sortId = to.query.sortId let _sortId = to.query.sortId
@ -72,7 +71,7 @@ const verifyQueryParams = async function(this: any, to: { query: Query, path: st
tagId.value = _tagId ?? '' tagId.value = _tagId ?? ''
sortId.value = _sortId ?? '' sortId.value = _sortId ?? ''
page.value = _page ? parseInt(_page) : 1 page.value = _page ? parseInt(_page) : 1
setSongListSetting({ source: _source, tagId: _tagId, sortId: _sortId }) void setSongListSetting({ source: _source, tagId: _tagId, sortId: _sortId })
} }
@ -95,7 +94,7 @@ export default {
const route = useRoute() const route = useRoute()
const handleToggleSource = (id: LX.OnlineSource) => { const handleToggleSource = (id: LX.OnlineSource) => {
if (id == source.value) return if (id == source.value) return
router.replace({ void router.replace({
path: route.path, path: route.path,
query: { query: {
source: id, source: id,