From 18a3bbbd49c43e98f94d3aee098eeff902145194 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 6 Mar 2026 15:25:30 +0200 Subject: [PATCH] lint --- src/components/attachment/attachment.js | 3 ++- src/components/chat_list_item/chat_list_item.js | 4 +--- src/components/font_control/font_control.js | 12 ++++++++++-- src/components/gallery/gallery.js | 2 +- src/components/lists_edit/lists_edit.js | 9 ++++----- src/components/notification/notification.js | 1 - src/components/settings_modal/helpers/setting.js | 9 ++++++--- src/components/settings_modal/tabs/general_tab.js | 1 + src/components/status_body/status_body.js | 4 +--- src/components/user_card/user_card.js | 8 ++++---- src/lib/style.js | 3 ++- .../entity_normalizer/entity_normalizer.service.js | 2 +- src/services/html_converter/utility.service.js | 4 +++- src/stores/local_config.js | 4 ++-- src/stores/sync_config.js | 13 +++++-------- 15 files changed, 43 insertions(+), 36 deletions(-) diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 2fb8064d9..32d8426b8 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -187,7 +187,8 @@ const Attachment = { if ( this.mergedConfig.useOneClickNsfw && !this.showHidden && - (this.attachment.type !== 'video' || this.mergedConfig.playVideosInModal) + (this.attachment.type !== 'video' || + this.mergedConfig.playVideosInModal) ) { this.openModal(event) return diff --git a/src/components/chat_list_item/chat_list_item.js b/src/components/chat_list_item/chat_list_item.js index 202455c53..74df26c1f 100644 --- a/src/components/chat_list_item/chat_list_item.js +++ b/src/components/chat_list_item/chat_list_item.js @@ -25,9 +25,7 @@ const ChatListItem = { return } - const types = this.chat.lastMessage.attachments.map((file) => - file.type, - ) + const types = this.chat.lastMessage.attachments.map((file) => file.type) if (types.includes('video')) { return this.$t('file_type.video') } else if (types.includes('audio')) { diff --git a/src/components/font_control/font_control.js b/src/components/font_control/font_control.js index c52c31bfe..db55319ce 100644 --- a/src/components/font_control/font_control.js +++ b/src/components/font_control/font_control.js @@ -1,7 +1,7 @@ import Checkbox from 'src/components/checkbox/checkbox.vue' import Popover from 'src/components/popover/popover.vue' -import Select from '../select/select.vue' import LocalSettingIndicator from 'src/components/settings_modal/helpers/local_setting_indicator.vue' +import Select from '../select/select.vue' import { useInterfaceStore } from 'src/stores/interface.js' @@ -21,7 +21,15 @@ export default { Popover, LocalSettingIndicator, }, - props: ['name', 'label', 'modelValue', 'fallback', 'options', 'no-inherit', 'isLocal'], + props: [ + 'name', + 'label', + 'modelValue', + 'fallback', + 'options', + 'no-inherit', + 'isLocal', + ], mounted() { useInterfaceStore().queryLocalFonts() }, diff --git a/src/components/gallery/gallery.js b/src/components/gallery/gallery.js index 42cc6cfd6..fafb66dbd 100644 --- a/src/components/gallery/gallery.js +++ b/src/components/gallery/gallery.js @@ -4,7 +4,7 @@ import Attachment from '../attachment/attachment.vue' import { useMediaViewerStore } from 'src/stores/media_viewer.js' -const displayTypes = new Set(["image", "video", "flash"]) +const displayTypes = new Set(['image', 'video', 'flash']) const Gallery = { props: [ diff --git a/src/components/lists_edit/lists_edit.js b/src/components/lists_edit/lists_edit.js index bdadd4fca..483a9c02a 100644 --- a/src/components/lists_edit/lists_edit.js +++ b/src/components/lists_edit/lists_edit.js @@ -124,11 +124,10 @@ const ListsNew = { useListsStore() .createList({ title: this.titleDraft }) .then((list) => { - useListsStore() - .setListAccounts({ - listId: list.id, - accountIds: [...this.addedUserIds], - }) + useListsStore().setListAccounts({ + listId: list.id, + accountIds: [...this.addedUserIds], + }) return list.id }) .then((listId) => { diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index b6ebc4364..f5a680023 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -183,7 +183,6 @@ const Notification = { return highlightClass(this.notification.from_profile) }, userStyle() { - const highlight = useSyncConfigStore().mergedConfig.highlight const user = this.notification.from_profile return highlightStyle(useUserHighlightStore().get(user)) }, diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js index 4bbf2a612..fc5f89175 100644 --- a/src/components/settings_modal/helpers/setting.js +++ b/src/components/settings_modal/helpers/setting.js @@ -1,13 +1,13 @@ import { cloneDeep, get, isEqual, set } from 'lodash' import DraftButtons from './draft_buttons.vue' -import ModifiedIndicator from './modified_indicator.vue' import LocalSettingIndicator from './local_setting_indicator.vue' +import ModifiedIndicator from './modified_indicator.vue' import { useInstanceStore } from 'src/stores/instance.js' import { useInterfaceStore } from 'src/stores/interface.js' -import { useSyncConfigStore } from 'src/stores/sync_config.js' import { useLocalConfigStore } from 'src/stores/local_config.js' +import { useSyncConfigStore } from 'src/stores/sync_config.js' export default { components: { @@ -300,7 +300,10 @@ export default { const revert = () => { if (this.local) { - useLocalConfigStore().unsetTemporarily({ path: writePath, value }) + useLocalConfigStore().unsetTemporarily({ + path: writePath, + value, + }) } else { useSyncConfigStore().setPreference({ path: writePath, diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js index d67bc948d..b0eac97c0 100644 --- a/src/components/settings_modal/tabs/general_tab.js +++ b/src/components/settings_modal/tabs/general_tab.js @@ -10,6 +10,7 @@ import UnitSetting from '../helpers/unit_setting.vue' import { useInstanceStore } from 'src/stores/instance.js' import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js' +import { useLocalConfigStore } from 'src/stores/local_config.js' import { useSyncConfigStore } from 'src/stores/sync_config.js' import localeService from 'src/services/locale/locale.service.js' diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js index ecc59719c..06adcfea8 100644 --- a/src/components/status_body/status_body.js +++ b/src/components/status_body/status_body.js @@ -103,9 +103,7 @@ const StatusBody = { ) }, attachmentTypes() { - return this.status.attachments.map((file) => - file.type, - ) + return this.status.attachments.map((file) => file.type) }, collapsedStatus() { return this.status.raw_html.replace(/(\n|)/g, ' ') diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index 491238937..ce667d0c2 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -227,14 +227,14 @@ export default { })) }, userHighlightType: { - get () { + get() { return useUserHighlightStore().get(this.user.screen_name).type }, - set (type) { + set(type) { if (type !== 'disabled') { useUserHighlightStore().setAndSave({ user: this.user.screen_name, - value: { type } + value: { type }, }) } else { useUserHighlightStore().unsetAndSave({ user: this.user.screen_name }) @@ -248,7 +248,7 @@ export default { set(color) { useUserHighlightStore().setAndSave({ user: this.user.screen_name, - value: { color } + value: { color }, }) }, }, diff --git a/src/lib/style.js b/src/lib/style.js index 3b2d9dad4..50120b37b 100644 --- a/src/lib/style.js +++ b/src/lib/style.js @@ -1,6 +1,7 @@ -import { applyStyleConfig } from 'src/services/style_setter/style_setter.js' import { useSyncConfigStore } from 'src/stores/sync_config.js' +import { applyStyleConfig } from 'src/services/style_setter/style_setter.js' + const ACTIONS = new Set([ 'setPreference', 'unsetPreference', diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 0135d1651..3f1b3e253 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -1,8 +1,8 @@ import { parseLinkHeader } from '@web3-storage/parse-link-header' import escapeHtml from 'escape-html' -import fileTypeService from '../file_type/file_type.service.js' import punycode from 'punycode.js' +import fileTypeService from '../file_type/file_type.service.js' import { isStatusNotification } from '../notification_utils/notification_utils.js' /** NOTICE! ** diff --git a/src/services/html_converter/utility.service.js b/src/services/html_converter/utility.service.js index 4c36eda2f..684f96ca1 100644 --- a/src/services/html_converter/utility.service.js +++ b/src/services/html_converter/utility.service.js @@ -23,7 +23,9 @@ export const getAttrs = (tag, filter) => { .replace(/\/?$/, '') .trim() const attrs = Array.from( - innertag.matchAll(/([a-z]+[a-z0-9-]*)(?:=((?:"(?:\\.|[^"\\])*")|(?:'(?:\\.|[^'\\])*')))?/gi), + innertag.matchAll( + /([a-z]+[a-z0-9-]*)(?:=((?:"(?:\\.|[^"\\])*")|(?:'(?:\\.|[^'\\])*')))?/gi, + ), ) .map(([, key, value]) => [key, value]) .map(([k, v]) => { diff --git a/src/stores/local_config.js b/src/stores/local_config.js index 60d02f717..117be393d 100644 --- a/src/stores/local_config.js +++ b/src/stores/local_config.js @@ -11,8 +11,8 @@ export const defaultState = { ...configDefaultState, }, tempStorage: { - ...configDefaultState - } + ...configDefaultState, + }, } export const useLocalConfigStore = defineStore('local_config', { diff --git a/src/stores/sync_config.js b/src/stores/sync_config.js index 057fb86ea..d0915e8aa 100644 --- a/src/stores/sync_config.js +++ b/src/stores/sync_config.js @@ -398,7 +398,11 @@ export const _resetPrefs = ( totalFlags.reset <= COMMAND_WIPE_JOURNAL_AND_STORAGE ) { console.debug('Received command to reset journals') - clearJournals() + this.flagStorage.reset = COMMAND_WIPE_JOURNAL + this.prefsStorage._journal = [] + this.cache.prefsStorage._journal = [] + this.raw.prefsStorage._journal = [] + this.pushSyncConfig() if (totalFlags.reset === COMMAND_WIPE_JOURNAL_AND_STORAGE) { console.debug('Received command to reset storage') return cloneDeep(defaultState) @@ -598,13 +602,6 @@ export const useSyncConfigStore = defineStore('sync_config', { }) this.flagStorage.reset = COMMAND_WIPE_JOURNAL_AND_STORAGE }, - clearJournals() { - this.flagStorage.reset = COMMAND_WIPE_JOURNAL - this.prefsStorage._journal = [] - this.cache.prefsStorage._journal = [] - this.raw.prefsStorage._journal = [] - this.pushSyncConfig() - }, initSyncConfig(userData) { console.log(userData) const live = userData.storage