From 8fa24d0c4005bf9892fa495b459b8b3165db908b Mon Sep 17 00:00:00 2001 From: Floatingghost Date: Wed, 29 May 2024 03:59:37 +0100 Subject: [PATCH] migrate to eslint 9 syntax --- .eslintignore | 2 -- .eslintrc.js | 30 ---------------- eslint.config.js | 31 +++++++++++++++++ src/components/about/about.vue | 2 +- .../account_actions/account_actions.vue | 6 ++-- src/components/attachment/attachment.vue | 4 +-- src/components/avatar_list/avatar_list.vue | 2 +- src/components/checkbox/checkbox.vue | 4 +-- src/components/color_input/color_input.vue | 4 +-- .../confirm_modal/confirm_modal.vue | 4 +-- src/components/conversation/conversation.js | 6 ++-- src/components/conversation/conversation.vue | 4 +-- src/components/desktop_nav/desktop_nav.vue | 4 +-- .../domain_mute_card/domain_mute_card.vue | 4 +-- .../edit_status_modal/edit_status_modal.vue | 8 ++--- src/components/emoji_input/emoji_input.vue | 5 ++- src/components/emoji_input/suggestor.js | 4 +-- .../emoji_reactions/emoji_reactions.vue | 2 +- .../extra_buttons/extra_buttons.vue | 6 ++-- .../favorite_button/favorite_button.vue | 2 +- .../features_panel/features_panel.vue | 2 +- .../follow_request_card.vue | 5 ++- src/components/font_control/font_control.vue | 2 +- src/components/gallery/gallery.vue | 4 +-- src/components/hashtag_link/hashtag_link.vue | 4 +-- .../instance_specific_panel.vue | 2 +- .../local_bubble_panel/local_bubble_panel.vue | 2 +- src/components/login_form/login_form.vue | 2 +- src/components/media_modal/media_modal.vue | 2 +- src/components/media_upload/media_upload.js | 2 +- src/components/media_upload/media_upload.vue | 2 +- src/components/mention_link/mention_link.vue | 4 +-- .../mentions_line/mentions_line.vue | 2 +- src/components/mfa_form/recovery_form.vue | 2 +- .../tabs/reports_tab/report_card.vue | 21 +++++++----- .../tabs/reports_tab/report_note.vue | 2 +- src/components/modal/modal.vue | 3 ++ .../moderation_tools/moderation_tools.vue | 8 ++--- src/components/nav_panel/nav_panel.vue | 2 +- .../notifications/notification_filters.vue | 4 +-- .../opacity_input/opacity_input.vue | 2 +- src/components/pinch_zoom/pinch_zoom.vue | 1 - .../post_status_form/post_status_form.vue | 4 +-- .../post_status_modal/post_status_modal.vue | 2 +- src/components/react_button/react_button.vue | 6 ++-- src/components/remote_follow/remote_follow.js | 2 +- .../retweet_button/retweet_button.vue | 2 +- .../selectable_list/selectable_list.vue | 4 +-- .../helpers/boolean_setting.vue | 2 +- .../settings_modal/helpers/choice_setting.vue | 2 +- .../helpers/modified_indicator.vue | 4 +-- .../helpers/server_side_indicator.vue | 4 +-- .../settings_modal/settings_modal.vue | 2 +- .../tabs/data_import_export_tab.js | 2 +- .../settings_modal/tabs/general_tab.vue | 16 ++++++--- .../tabs/mutes_and_blocks_tab.js | 2 +- .../tabs/mutes_and_blocks_tab.vue | 34 +++++++++---------- .../settings_modal/tabs/profile_tab.js | 6 ++-- .../settings_modal/tabs/profile_tab.vue | 6 ++-- .../shadow_control/shadow_control.vue | 2 +- src/components/side_drawer/side_drawer.vue | 2 +- src/components/staff_panel/staff_panel.vue | 2 +- src/components/status/status.vue | 6 ++-- src/components/status_body/status_body.vue | 11 +++--- .../status_content/status_content.vue | 4 +-- .../status_history_modal.vue | 6 ++-- .../status_popover/status_popover.vue | 6 ++-- src/components/still-image/still-image.vue | 5 +-- .../terms_of_service_panel.vue | 2 +- src/components/thread_tree/thread_tree.vue | 2 +- .../timeline/timeline_quick_settings.vue | 4 +-- .../timeline_menu/timeline_menu.vue | 6 ++-- .../timeline_menu/timeline_menu_content.vue | 3 +- .../timeline_menu_content.vue | 2 +- .../timeline_menu_tabs/timeline_menu_tabs.vue | 6 ++-- src/components/user_card/user_card.js | 2 +- .../user_list_popover/user_list_popover.vue | 6 ++-- src/components/user_profile/user_profile.vue | 4 +-- .../user_reporting_modal.vue | 4 +-- .../who_to_follow_panel.vue | 2 +- src/i18n/service_worker_messages.js | 1 - src/lib/event_target_polyfill.js | 4 +-- src/main.js | 2 +- src/modules/auth_flow.js | 2 +- src/services/export_import/export_import.js | 2 +- 85 files changed, 215 insertions(+), 197 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js create mode 100644 eslint.config.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 34af3774..00000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -build/*.js -config/*.js diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 28d39d03..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,30 +0,0 @@ -module.exports = { - root: true, - parserOptions: { - parser: '@babel/eslint-parser', - sourceType: 'module' - }, - // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style - extends: [ - 'plugin:vue/recommended' - ], - // required to lint *.vue files - plugins: [ - 'vue', - 'import' - ], - // add your custom rules here - rules: { - // allow paren-less arrow functions - 'arrow-parens': 0, - // allow async-await - 'generator-star-spacing': 0, - // allow debugger during development - 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, - 'vue/require-prop-types': 0, - 'vue/no-unused-vars': 0, - 'no-tabs': 0, - 'vue/multi-word-component-names': 0, - 'vue/no-reserved-component-names': 0 - } -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..13bac794 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,31 @@ +const pluginVue = require('eslint-plugin-vue') +const pluginImport = require('eslint-plugin-import') + +module.exports = [ + ...pluginVue.configs['flat/recommended'], + { + languageOptions: { + parserOptions: { + parser: '@babel/eslint-parser', + sourceType: 'module' + } + }, + rules: { + // allow paren-less arrow functions + 'arrow-parens': 0, + // allow async-await + 'generator-star-spacing': 0, + // allow debugger during development + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, + 'vue/require-prop-types': 0, + 'vue/no-unused-vars': 0, + 'no-tabs': 0, + 'vue/multi-word-component-names': 0, + 'vue/no-reserved-component-names': 0 + }, + ignores: [ + 'build/*.js', + 'config/*.js' + ] + } +] diff --git a/src/components/about/about.vue b/src/components/about/about.vue index df9bb196..edf16b0b 100644 --- a/src/components/about/about.vue +++ b/src/components/about/about.vue @@ -9,7 +9,7 @@ - + diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index 126f6fa9..656fe802 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -6,7 +6,7 @@ :bound-to="{ x: 'container' }" remove-padding > -