diff --git a/eslint.config.mjs b/eslint.config.mjs index f2d7231e..aa5dcf95 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -2,6 +2,7 @@ import eslint from '@eslint/js'; import prettier from 'eslint-plugin-prettier/recommended'; +import solid from 'eslint-plugin-solid/configs/recommended'; import stylistic from '@stylistic/eslint-plugin-js'; import tsEslint from 'typescript-eslint'; @@ -12,6 +13,7 @@ export default tsEslint.config( tsEslint.configs.eslintRecommended, ...tsEslint.configs.recommendedTypeChecked, prettier, + solid, { ignores: ['dist', 'node_modules', '*.config.*js', '*.test.*js'] }, { plugins: { diff --git a/package.json b/package.json index 5b2911a8..6e8d83e8 100644 --- a/package.json +++ b/package.json @@ -163,6 +163,7 @@ "eslint-import-resolver-typescript": "4.4.4", "eslint-plugin-import": "2.32.0", "eslint-plugin-prettier": "5.5.1", + "eslint-plugin-solid": "0.14.5", "glob": "11.0.3", "node-gyp": "11.2.0", "playwright": "1.53.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74cc8b5a..a9335bd7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -329,6 +329,9 @@ importers: eslint-plugin-prettier: specifier: 5.5.1 version: 5.5.1(@types/eslint@9.6.1)(eslint-config-prettier@10.1.5(eslint@9.30.1))(eslint@9.30.1)(prettier@3.5.2) + eslint-plugin-solid: + specifier: 0.14.5 + version: 0.14.5(eslint@9.30.1)(typescript@5.8.3) glob: specifier: 11.0.3 version: 11.0.3 @@ -2501,6 +2504,13 @@ packages: eslint-config-prettier: optional: true + eslint-plugin-solid@0.14.5: + resolution: {integrity: sha512-nfuYK09ah5aJG/oEN6P1qziy1zLgW4PDWe75VNPi4CEFYk1x2AEqwFeQfEPR7gNn0F2jOeqKhx2E+5oNCOBYWQ==} + engines: {node: '>=18.0.0'} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 + typescript: '>=4.8.4' + eslint-scope@8.4.0: resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2882,6 +2892,10 @@ packages: html-entities@2.3.3: resolution: {integrity: sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==} + html-tags@3.3.1: + resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==} + engines: {node: '>=8'} + html-to-text@9.0.5: resolution: {integrity: sha512-qY60FjREgVZL03vJU6IfMV4GDjGBIoOyvuFdpBDIX9yTlDw0TjxVBQp+P8NvpdIXNJvfWBTNul7fsAQJq2FNpg==} engines: {node: '>=14'} @@ -2982,6 +2996,9 @@ packages: ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + inline-style-parser@0.2.4: + resolution: {integrity: sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==} + internal-slot@1.1.0: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} @@ -3066,6 +3083,10 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-html@2.0.0: + resolution: {integrity: sha512-S+OpgB5i7wzIue/YSE5hg0e5ZYfG3hhpNh9KGl6ayJ38p7ED6wxQLd1TV91xHpcTvw90KMJ9EwN3F/iNflHBVg==} + engines: {node: '>=8'} + is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} engines: {node: '>=14.16'} @@ -3265,6 +3286,9 @@ packages: jszip@3.10.1: resolution: {integrity: sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==} + kebab-case@1.0.2: + resolution: {integrity: sha512-7n6wXq4gNgBELfDCpzKc+mRrZFs7D+wgfF5WRFLNAr4DA/qtr9Js8uOAVAfHhuLMfAcQ0pRKqbpjx+TcJVdE1Q==} + keyboardevent-from-electron-accelerator@2.0.0: resolution: {integrity: sha512-iQcmNA0M4ETMNi0kG/q0h/43wZk7rMeKYrXP7sqKIJbHkTU8Koowgzv+ieR/vWJbOwxx5nDC3UnudZ0aLSu4VA==} @@ -3274,6 +3298,9 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + known-css-properties@0.30.0: + resolution: {integrity: sha512-VSWXYUnsPu9+WYKkfmJyLKtIvaRJi1kXUqVmBACORXZQxT5oZDsoZ2vQP+bQFDnWtpI/4eq3MLoRMjI2fnLzTQ==} + kuromoji@0.1.2: resolution: {integrity: sha512-V0dUf+C2LpcPEXhoHLMAop/bOht16Dyr+mDiIE39yX3vqau7p80De/koFqpiTcL1zzdZlc3xuHZ8u5gjYRfFaQ==} @@ -4443,6 +4470,9 @@ packages: stubborn-fs@1.2.5: resolution: {integrity: sha512-H2N9c26eXjzL/S/K+i/RHHcFanE74dptvvjM8iwzwbVcWY/zjBbgRqF3K0DY4+OD+uTTASTBvDoxPDaPN02D7g==} + style-to-object@1.0.9: + resolution: {integrity: sha512-G4qppLgKu/k6FwRpHiGiKPaPTFcG3g4wNVX/Qsfu+RqQM30E7Tyu/TEgxcL9PNLF5pdRLwQdE3YKKf+KF2Dzlw==} + sumchecker@3.0.1: resolution: {integrity: sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==} engines: {node: '>= 8.0'} @@ -7374,6 +7404,19 @@ snapshots: '@types/eslint': 9.6.1 eslint-config-prettier: 10.1.5(eslint@9.30.1) + eslint-plugin-solid@0.14.5(eslint@9.30.1)(typescript@5.8.3): + dependencies: + '@typescript-eslint/utils': 8.36.0(eslint@9.30.1)(typescript@5.8.3) + eslint: 9.30.1 + estraverse: 5.3.0 + is-html: 2.0.0 + kebab-case: 1.0.2 + known-css-properties: 0.30.0 + style-to-object: 1.0.9 + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + eslint-scope@8.4.0: dependencies: esrecurse: 4.3.0 @@ -7828,6 +7871,8 @@ snapshots: html-entities@2.3.3: {} + html-tags@3.3.1: {} + html-to-text@9.0.5: dependencies: '@selderee/plugin-htmlparser2': 0.11.0 @@ -7937,6 +7982,8 @@ snapshots: ini@1.3.8: {} + inline-style-parser@0.2.4: {} + internal-slot@1.1.0: dependencies: es-errors: 1.3.0 @@ -8026,6 +8073,10 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-html@2.0.0: + dependencies: + html-tags: 3.3.1 + is-inside-container@1.0.0: dependencies: is-docker: 3.0.0 @@ -8221,6 +8272,8 @@ snapshots: readable-stream: 2.3.8 setimmediate: 1.0.5 + kebab-case@1.0.2: {} + keyboardevent-from-electron-accelerator@2.0.0: {} keyboardevents-areequal@0.2.2: {} @@ -8229,6 +8282,8 @@ snapshots: dependencies: json-buffer: 3.0.1 + known-css-properties@0.30.0: {} + kuromoji@0.1.2(patch_hash=4a948f1ea45c61779fa371feb020253ccf7a24e1f7c6b2e250b3ce53d86216d4): dependencies: async: 2.6.4 @@ -9415,6 +9470,10 @@ snapshots: stubborn-fs@1.2.5: {} + style-to-object@1.0.9: + dependencies: + inline-style-parser: 0.2.4 + sumchecker@3.0.1: dependencies: debug: 4.4.1 diff --git a/src/plugins/adblocker/index.ts b/src/plugins/adblocker/index.ts index ade1b479..5cacba7c 100644 --- a/src/plugins/adblocker/index.ts +++ b/src/plugins/adblocker/index.ts @@ -76,7 +76,7 @@ export default createPlugin({ async onPlayerApiReady(_, { getConfig }) { const config = await getConfig(); if (config.blocker === blockers.AdSpeedup) { - await loadAdSpeedup(); + loadAdSpeedup(); } }, }, diff --git a/src/plugins/album-actions/templates/dislike-button.tsx b/src/plugins/album-actions/templates/dislike-button.tsx index 85da24ed..c9767492 100644 --- a/src/plugins/album-actions/templates/dislike-button.tsx +++ b/src/plugins/album-actions/templates/dislike-button.tsx @@ -12,7 +12,7 @@ export const DislikeButton = (props: DislikeButtonProps) => ( class="like-menu yt-spec-button-shape-next yt-spec-button-shape-next--text yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-button" aria-pressed="false" aria-label="Dislike all" - onClick={props.onClick} + onClick={(e) => props.onClick?.(e)} >
diff --git a/src/plugins/album-actions/templates/like-button.tsx b/src/plugins/album-actions/templates/like-button.tsx index eacb14c1..6e35e78b 100644 --- a/src/plugins/album-actions/templates/like-button.tsx +++ b/src/plugins/album-actions/templates/like-button.tsx @@ -12,7 +12,7 @@ export const LikeButton = (props: LikeButtonProps) => ( class="like-menu yt-spec-button-shape-next yt-spec-button-shape-next--text yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-button" aria-pressed="false" aria-label="Like all" - onClick={props.onClick} + onClick={(e) => props.onClick?.(e)} > @@ -95,8 +95,8 @@ export const UnDislikeButton = (props: UnDislikeButtonProps) => ( class="yt-spec-touch-feedback-shape yt-spec-touch-feedback-shape--touch-response" aria-hidden="true" > - - + + diff --git a/src/plugins/album-actions/templates/unlike-button.tsx b/src/plugins/album-actions/templates/unlike-button.tsx index e4e95882..d211ad6f 100644 --- a/src/plugins/album-actions/templates/unlike-button.tsx +++ b/src/plugins/album-actions/templates/unlike-button.tsx @@ -12,7 +12,7 @@ export const UnLikeButton = (props: UnLikeButtonProps) => ( class="like-menu yt-spec-button-shape-next yt-spec-button-shape-next--text yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-button" aria-pressed="false" aria-label="Unlike all" - onClick={props.onClick} + onClick={(e) => props.onClick?.(e)} > @@ -81,7 +81,7 @@ export const UnLikeButton = (props: UnLikeButtonProps) => (