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 > - + - + - + diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 0ccdb776..1d37bf43 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -246,8 +246,8 @@ ref="flash" class="flash" :src="attachment.large_thumb_url || attachment.url" - @playerOpened="setFlashLoaded(true)" - @playerClosed="setFlashLoaded(false)" + @player-opened="setFlashLoaded(true)" + @player-closed="setFlashLoaded(false)" /> diff --git a/src/components/avatar_list/avatar_list.vue b/src/components/avatar_list/avatar_list.vue index e1b6e971..9a6ca3f6 100644 --- a/src/components/avatar_list/avatar_list.vue +++ b/src/components/avatar_list/avatar_list.vue @@ -14,7 +14,7 @@ - + + - - diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index f8df9eb5..68b90c72 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -267,11 +267,11 @@ const conversation = { }, replies () { let i = 1 - // eslint-disable-next-line camelcase + return reduce(this.conversation, (result, { id, in_reply_to_status_id }) => { - /* eslint-disable camelcase */ + const irid = in_reply_to_status_id - /* eslint-enable camelcase */ + if (irid) { result[irid] = result[irid] || [] result[irid].push({ diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index 1adbe250..61f1358a 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -91,7 +91,7 @@ :controlled-set-media-playing="(newVal) => toggleStatusContentProperty(status.id, 'mediaPlaying', newVal)" @goto="setHighlight" - @toggleExpanded="toggleExpanded" + @toggle-expanded="toggleExpanded" /> diff --git a/src/components/desktop_nav/desktop_nav.vue b/src/components/desktop_nav/desktop_nav.vue index f50d1b3e..aa5edd40 100644 --- a/src/components/desktop_nav/desktop_nav.vue +++ b/src/components/desktop_nav/desktop_nav.vue @@ -44,9 +44,9 @@ /> {{ $t('domain_mute_card.unmute') }} - + {{ $t('domain_mute_card.unmute_progress') }} @@ -19,7 +19,7 @@ class="btn button-default" > {{ $t('domain_mute_card.mute') }} - + {{ $t('domain_mute_card.mute_progress') }} diff --git a/src/components/edit_status_modal/edit_status_modal.vue b/src/components/edit_status_modal/edit_status_modal.vue index 00dde7de..ab3ea0b8 100644 --- a/src/components/edit_status_modal/edit_status_modal.vue +++ b/src/components/edit_status_modal/edit_status_modal.vue @@ -2,7 +2,7 @@ @@ -11,10 +11,10 @@ diff --git a/src/components/emoji_input/emoji_input.vue b/src/components/emoji_input/emoji_input.vue index d4760edc..aeacf544 100644 --- a/src/components/emoji_input/emoji_input.vue +++ b/src/components/emoji_input/emoji_input.vue @@ -43,7 +43,10 @@ :class="{ highlighted: index === highlighted }" @click.stop.prevent="onClick($event, suggestion)" > - + { const screenNameAlphabetically = a.screen_name > b.screen_name ? 1 : -1 return diff + nameAlphabetically + screenNameAlphabetically - /* eslint-disable camelcase */ + }).map(({ screen_name, screen_name_ui, name, profile_image_url_original }) => ({ displayText: screen_name_ui, detailText: name, imageUrl: profile_image_url_original, replacement: '@' + screen_name + ' ' })) - /* eslint-enable camelcase */ + suggestions = newSuggestions || [] return suggestions diff --git a/src/components/emoji_reactions/emoji_reactions.vue b/src/components/emoji_reactions/emoji_reactions.vue index d5e4301e..be70d522 100644 --- a/src/components/emoji_reactions/emoji_reactions.vue +++ b/src/components/emoji_reactions/emoji_reactions.vue @@ -42,7 +42,7 @@ - +