From 10384b6c4c1cd4a57f4b804353f930c2a3ddca1c Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Sat, 6 Sep 2025 04:51:31 +0900 Subject: [PATCH] chore(eslint): added new eslint rule (for jsx) --- eslint.config.mjs | 3 + src/plugins/album-actions/index.tsx | 8 +-- .../templates/dislike-button.tsx | 28 ++++---- .../album-actions/templates/like-button.tsx | 28 ++++---- .../templates/undislike-button.tsx | 28 ++++---- .../album-actions/templates/unlike-button.tsx | 28 ++++---- .../templates/captions-settings-template.tsx | 2 +- src/plugins/custom-output-device/renderer.ts | 12 +++- src/plugins/downloader/templates/download.tsx | 2 +- src/plugins/in-app-menu/renderer.tsx | 4 +- src/plugins/in-app-menu/renderer/Panel.tsx | 6 +- .../in-app-menu/renderer/PanelItem.tsx | 52 +++++++-------- src/plugins/in-app-menu/renderer/TitleBar.tsx | 66 +++++++++---------- .../in-app-menu/renderer/WindowController.tsx | 26 ++++---- .../templates/picture-in-picture-button.tsx | 6 +- .../playback-speed/components/slider.tsx | 4 +- src/plugins/playback-speed/renderer.tsx | 4 +- .../templates/quality-setting-button.tsx | 2 +- .../renderer/components/ErrorDisplay.tsx | 2 +- .../renderer/components/LyricsPicker.tsx | 18 ++--- .../renderer/components/SyncedLine.tsx | 4 +- .../synced-lyrics/renderer/renderer.tsx | 2 +- src/plugins/video-toggle/index.tsx | 2 +- .../templates/video-switch-button.tsx | 2 +- src/providers/song-controls.ts | 1 + src/providers/song-info-front.ts | 3 +- 26 files changed, 177 insertions(+), 166 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 0e7a9d29..2586a781 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -31,6 +31,9 @@ export default tsEslint.config( rules: { 'stylistic/arrow-parens': ['error', 'always'], 'stylistic/object-curly-spacing': ['error', 'always'], + 'stylistic/jsx-pascal-case': 'error', + 'stylistic/jsx-curly-spacing': ['error', { when: 'never', children: true }], + 'stylistic/jsx-sort-props': 'error', 'prettier/prettier': ['error', { singleQuote: true, semi: true, tabWidth: 2, trailingComma: 'all', quoteProps: 'preserve' }], '@typescript-eslint/no-floating-promises': 'off', '@typescript-eslint/no-misused-promises': ['off', { checksVoidReturn: false }], diff --git a/src/plugins/album-actions/index.tsx b/src/plugins/album-actions/index.tsx index 7c1b0001..80739b49 100644 --- a/src/plugins/album-actions/index.tsx +++ b/src/plugins/album-actions/index.tsx @@ -81,26 +81,26 @@ export default createPlugin< <> diff --git a/src/plugins/album-actions/templates/dislike-button.tsx b/src/plugins/album-actions/templates/dislike-button.tsx index c9767492..b0b88b1d 100644 --- a/src/plugins/album-actions/templates/dislike-button.tsx +++ b/src/plugins/album-actions/templates/dislike-button.tsx @@ -6,22 +6,23 @@ export interface DislikeButtonProps { export const DislikeButton = (props: DislikeButtonProps) => (