manual lint --fix

This commit is contained in:
Henry Jameson 2025-02-04 15:23:21 +02:00
commit d1ea589531
76 changed files with 187 additions and 184 deletions

View file

@ -145,7 +145,7 @@ const Attachment = {
window.open(target.href, '_blank')
}
},
openModal (event) {
openModal () {
if (this.useModal) {
this.$emit('setMedia')
useMediaViewerStore().setCurrentMedia(this.attachment)
@ -153,7 +153,7 @@ const Attachment = {
window.open(this.attachment.url)
}
},
openModalForce (event) {
openModalForce () {
this.$emit('setMedia')
useMediaViewerStore().setCurrentMedia(this.attachment)
},

View file

@ -52,7 +52,7 @@ const ChatListItem = {
}
},
methods: {
openChat (_e) {
openChat () {
if (this.chat.id) {
this.$router.push({
name: 'chat',

View file

@ -53,7 +53,7 @@ export default {
}
},
methods: {
onTransitionEnd (e) {
onTransitionEnd () {
if (!this.indeterminate) {
this.indeterminateTransitionFix = false
}

View file

@ -114,7 +114,7 @@ const conversation = {
suspendable () {
if (this.isTreeView) {
return Object.entries(this.statusContentProperties)
.every(([k, prop]) => !prop.replying && prop.mediaPlaying.length === 0)
.every(([, prop]) => !prop.replying && prop.mediaPlaying.length === 0)
}
if (this.$refs.statusComponent && this.$refs.statusComponent[0]) {
return this.$refs.statusComponent.every(s => s.suspendable)
@ -272,11 +272,8 @@ const conversation = {
},
replies () {
let i = 1
return reduce(this.conversation, (result, { id, in_reply_to_status_id }) => {
const irid = in_reply_to_status_id
return reduce(this.conversation, (result, { id, in_reply_to_status_id: irid }) => {
if (irid) {
result[irid] = result[irid] || []
result[irid].push({
@ -381,7 +378,7 @@ const conversation = {
this.resetDisplayState()
}
},
virtualHidden (value) {
virtualHidden () {
this.$store.dispatch(
'setVirtualHeight',
{ statusId: this.statusId, height: `${this.$el.clientHeight}px` }
@ -477,7 +474,7 @@ const conversation = {
// nothing found, fall back to toplevel
return this.topLevel[0] ? this.topLevel[0].id : undefined
},
diveIntoStatus (id, preventScroll) {
diveIntoStatus (id) {
this.tryScrollTo(id)
},
diveToTopLevel () {

View file

@ -265,7 +265,7 @@ const EmojiInput = {
}
},
watch: {
showSuggestions: function (newValue, oldValue) {
showSuggestions: function (newValue) {
this.$emit('shown', newValue)
if (newValue) {
this.$refs.suggestorPopover.showPopover()

View file

@ -116,7 +116,6 @@ export const suggestUsers = ({ dispatch, state }) => {
const screenNameAlphabetically = a.screen_name > b.screen_name ? 1 : -1
return diff + nameAlphabetically + screenNameAlphabetically
}).map((user) => ({
user,
displayText: user.screen_name_ui,
@ -124,7 +123,6 @@ export const suggestUsers = ({ dispatch, state }) => {
imageUrl: user.profile_image_url_original,
replacement: '@' + user.screen_name + ' '
}))
suggestions = newSuggestions || []
return suggestions

View file

@ -352,7 +352,7 @@ const EmojiPicker = {
},
allEmojiGroups () {
return Object.entries(this.allCustomGroups)
.map(([_, v]) => v)
.map(([, v]) => v)
.concat(this.unicodeEmojiGroups)
},
stickerPickerEnabled () {

View file

@ -71,7 +71,7 @@ const EmojiReactions = {
unreact (emoji) {
this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji })
},
async emojiOnClick (emoji, event) {
async emojiOnClick (emoji) {
if (!this.loggedIn) return
await this.fetchEmojiReactionsByIfMissing()

View file

@ -37,7 +37,7 @@ export default {
},
getClass: {
type: Function,
default: item => ''
default: () => ''
},
nonInteractive: {
type: Boolean,

View file

@ -104,10 +104,10 @@ const ListsNew = {
removeUser (userId) {
useListsStore().removeListAccount({ accountId: userId, listId: this.id })
},
onSearchLoading (results) {
onSearchLoading () {
this.searchLoading = true
},
onSearchLoadingDone (results) {
onSearchLoadingDone () {
this.searchLoading = false
},
onSearchResults (results) {

View file

@ -96,12 +96,14 @@ const MentionLink = {
},
style () {
if (this.highlight) {
/* eslint-disable no-unused-vars */
const {
backgroundColor,
backgroundPosition,
backgroundImage,
...rest
} = highlightStyle(this.highlight)
/* eslint-enable no-unused-vars */
return rest
}
},

View file

@ -25,6 +25,7 @@ export default {
default: false
}
},
emits: ['backdropClicked'],
computed: {
classes () {
return {

View file

@ -100,7 +100,7 @@ const ModerationTools = {
const user = this.user
const { id, name } = user
store.state.api.backendInteractor.deleteUser({ user })
.then(e => {
.then(() => {
this.$store.dispatch('markStatusesAsDeleted', status => user.id === status.user.id)
const isProfile = this.$route.name === 'external-user-profile' || this.$route.name === 'user-profile'
const isTargetUser = this.$route.params.name === name || this.$route.params.id === id

View file

@ -87,7 +87,7 @@ const paletteExporter = newExporter({
})
const paletteImporter = newImporter({
accept: '.json',
onImport (parsed, filename) {
onImport (parsed) {
emit('update:modelValue', parsed)
}
})
@ -100,7 +100,7 @@ const importPalette = () => {
paletteImporter.importData()
}
const applyPalette = (data) => {
const applyPalette = () => {
emit('applyPalette', getExportedObject())
}

View file

@ -107,7 +107,7 @@ export default {
this.loading = true
usePollsStore().votePoll(
{ id: this.statusId, pollId: this.poll.id, choices: this.choiceIndices }
).then(poll => {
).then(() => {
this.loading = false
})
}

View file

@ -105,7 +105,7 @@ export default {
}
return false
},
deleteOption (index, event) {
deleteOption (index) {
if (this.options.length > 2) {
this.options.splice(index, 1)
}

View file

@ -280,7 +280,7 @@ const Popover = {
this.updateStyles()
}, 1)
},
onMouseenter (e) {
onMouseenter () {
if (this.trigger === 'hover') {
this.lockReEntry = false
clearTimeout(this.graceTimeout)
@ -288,12 +288,12 @@ const Popover = {
this.showPopover()
}
},
onMouseleave (e) {
onMouseleave () {
if (this.trigger === 'hover' && this.childrenShown.size === 0) {
this.graceTimeout = setTimeout(() => this.hidePopover(), 1)
}
},
onMouseenterContent (e) {
onMouseenterContent () {
if (this.trigger === 'hover' && !this.lockReEntry) {
this.lockReEntry = true
clearTimeout(this.graceTimeout)
@ -301,12 +301,12 @@ const Popover = {
this.showPopover()
}
},
onMouseleaveContent (e) {
onMouseleaveContent () {
if (this.trigger === 'hover' && this.childrenShown.size === 0) {
this.graceTimeout = setTimeout(() => this.hidePopover(), 1)
}
},
onClick (e) {
onClick () {
if (this.trigger === 'click') {
if (this.hidden) {
this.showPopover()
@ -324,10 +324,10 @@ const Popover = {
this.hidePopover()
if (this.parentPopover) this.parentPopover.onClickOutside(e)
},
onScroll (e) {
onScroll () {
this.updateStyles()
},
onResize (e) {
onResize () {
const content = this.$refs.content
if (!content) return
if (this.oldSize.width !== content.offsetWidth || this.oldSize.height !== content.offsetHeight) {

View file

@ -433,7 +433,7 @@ const PostStatusForm = {
if (this.preview) this.previewStatus()
this.saveable = false
},
async postStatus (event, newStatus, opts = {}) {
async postStatus (event, newStatus) {
if (this.posting && !this.optimisticPosting) { return }
if (this.disableSubmit) { return }
if (this.emojiInputShown) { return }
@ -459,7 +459,7 @@ const PostStatusForm = {
try {
await this.setAllMediaDescriptions()
} catch (e) {
} catch {
this.error = this.$t('post_status.media_description_error')
this.posting = false
return
@ -603,7 +603,7 @@ const PostStatusForm = {
this.showDropIcon = 'hide'
}
},
fileDragStop (e) {
fileDragStop () {
// The false-setting is done with delay because just using leave-events
// directly caused unwanted flickering, this is not perfect either but
// much less noticable.
@ -618,7 +618,7 @@ const PostStatusForm = {
this.showDropIcon = 'show'
}
},
onEmojiInputInput (e) {
onEmojiInputInput () {
this.$nextTick(() => {
this.resize(this.$refs.textarea)
})

View file

@ -2,7 +2,6 @@ export default {
props: ['user'],
computed: {
subscribeUrl () {
const serverUrl = new URL(this.user.statusnet_profile_url)
return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus`
}

View file

@ -93,7 +93,7 @@ const EmojiTab = {
this.displayError(resp.error)
return Promise.reject(resp)
}
}).then(done => {
}).then(() => {
this.$refs.createPackPopover.hidePopover()
this.packName = this.newPackName
@ -110,7 +110,7 @@ const EmojiTab = {
this.displayError(resp.error)
return Promise.reject(resp)
}
}).then(done => {
}).then(() => {
delete this.editedMetadata[this.packName]
this.deleteModalVisible = false
@ -167,7 +167,7 @@ const EmojiTab = {
return resultingPromise
})
.then(finished => allPacks)
.then(() => allPacks)
.catch(data => {
this.displayError(data)
})
@ -226,7 +226,7 @@ const EmojiTab = {
this.displayError(resp.error)
return Promise.reject(resp)
}
}).then(done => {
}).then(() => {
this.packName = this.remotePackDownloadAs
this.remotePackDownloadAs = ''
})

View file

@ -67,7 +67,7 @@ const AppearanceTab = {
value: i - 1,
label: this.$t(`settings.style.themes3.hacks.forced_roundness_mode_${mode}`)
})),
underlayOverrideModes: ['none', 'opaque', 'transparent'].map((mode, i) => ({
underlayOverrideModes: ['none', 'opaque', 'transparent'].map((mode) => ({
key: mode,
value: mode,
label: this.$t(`settings.style.themes3.hacks.underlay_override_mode_${mode}`)
@ -234,7 +234,7 @@ const AppearanceTab = {
cOrange,
wallpaper
}
return Object.fromEntries(Object.entries(result).filter(([k, v]) => v))
return Object.fromEntries(Object.entries(result).filter(([, v]) => v))
})
return result
},
@ -276,7 +276,7 @@ const AppearanceTab = {
const { customTheme, customThemeSource } = this.mergedConfig
return customTheme != null || customThemeSource != null
},
isCustomStyleUsed (name) {
isCustomStyleUsed () {
const { styleCustomData } = this.mergedConfig
return styleCustomData != null
},
@ -348,7 +348,7 @@ const AppearanceTab = {
useInterfaceStore().setPaletteCustom(data)
this.userPalette = data
},
resetTheming (name) {
resetTheming () {
useInterfaceStore().setStyle('stock')
},
previewTheme (key, version, input) {
@ -378,7 +378,7 @@ const AppearanceTab = {
directives: Object.fromEntries(
Object
.entries(directives)
.filter(([k, v]) => k && k !== 'name')
.filter(([k]) => k && k !== 'name')
.map(([k, v]) => ['--' + k, 'color | ' + v])
)
}

View file

@ -72,7 +72,6 @@ const DataImportExportTab = {
// check is it's a local user
if (user && user.is_local) {
// append the instance address
return user.screen_name + '@' + location.hostname
}
return user.screen_name
@ -80,7 +79,7 @@ const DataImportExportTab = {
},
addBackup () {
this.$store.state.api.backendInteractor.addBackup()
.then((res) => {
.then(() => {
this.addedBackup = true
this.addBackupError = false
})

View file

@ -85,7 +85,6 @@ const MutesAndBlocks = {
// check is it's a local user
if (user && user.is_local) {
// append the instance address
return user.screen_name + '@' + location.hostname
}
return user.screen_name
@ -126,7 +125,7 @@ const MutesAndBlocks = {
return urls.filter(url => !this.user.domainMutes.includes(url))
},
queryKnownDomains (query) {
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
resolve(this.knownDomains.filter(url => url.toLowerCase().includes(query)))
})
},

View file

@ -133,15 +133,14 @@ const ProfileTab = {
const params = {
note: this.newBio,
locked: this.newLocked,
// Backend notation.
display_name: this.newName,
fields_attributes: this.newFields.filter(el => el != null),
actor_type: this.actorType,
show_role: this.showRole,
birthday: this.newBirthday || '',
show_birthday: this.showBirthday
}
if (this.emailLanguage) {
@ -167,7 +166,7 @@ const ProfileTab = {
}
return false
},
deleteField (index, event) {
deleteField (index) {
this.newFields.splice(index, 1)
},
uploadFile (slot, e) {
@ -190,7 +189,7 @@ const ProfileTab = {
})
return
}
const reader = new FileReader()
reader.onload = ({ target }) => {
const img = target.result

View file

@ -89,7 +89,7 @@ const Mfa = {
this.backupCodes.getNewCodes = true
},
confirmBackupCodes () { // confirm getting new backup codes
this.fetchBackupCodes().then((res) => {
this.fetchBackupCodes().then(() => {
this.backupCodes.getNewCodes = false
})
},

View file

@ -124,7 +124,7 @@ const SecurityTab = {
},
addAlias () {
this.$store.state.api.backendInteractor.addAlias({ alias: this.addAliasTarget })
.then((res) => {
.then(() => {
this.addedAlias = true
this.addAliasError = false
this.addAliasTarget = ''

View file

@ -78,14 +78,14 @@ export default {
Preview,
VirtualDirectivesTab
},
setup (props, context) {
setup () {
const exports = {}
const interfaceStore = useInterfaceStore()
// All rules that are made by editor
const allEditedRules = ref(interfaceStore.styleDataUsed || {})
const styleDataUsed = computed(() => interfaceStore.styleDataUsed)
watch([styleDataUsed], (value) => {
watch([styleDataUsed], () => {
onImport(interfaceStore.styleDataUsed)
}, { once: true })
@ -227,7 +227,7 @@ export default {
componentKeysAll
.map(
key => [key, componentsContext(key).default]
).filter(([key, component]) => !component.virtual && !component.notEditable)
).filter(([, component]) => !component.virtual && !component.notEditable)
)
exports.componentsMap = componentsMap
const componentKeys = [...componentsMap.keys()]

View file

@ -480,7 +480,7 @@ export default {
}
this.dismissWarning()
},
loadThemeFromLocalStorage (confirmLoadSource = false, forceSnapshot = false) {
loadThemeFromLocalStorage (confirmLoadSource = false) {
const theme = this.themeDataUsed?.source
if (theme) {
this.loadTheme(
@ -536,7 +536,7 @@ export default {
this.tempImportFile = parsed
this.loadTheme(parsed, 'file', forceSource)
},
onImportFailure (result) {
onImportFailure () {
useInterfaceStore().pushGlobalNotice({ messageKey: 'settings.invalid_theme_imported', level: 'error' })
},
importValidator (parsed) {
@ -757,7 +757,7 @@ export default {
}
},
selected () {
this.selectedTheme = Object.entries(this.availableStyles).find(([k, s]) => {
this.selectedTheme = Object.entries(this.availableStyles).find(([, s]) => {
if (Array.isArray(s)) {
return s[0] === this.selected
} else {

View file

@ -151,7 +151,7 @@ export default {
}
},
watch: {
selected (value) {
selected () {
this.$emit('subShadowSelected', this.selectedId)
}
},

View file

@ -38,7 +38,7 @@ const shoutPanel = {
}
},
watch: {
messages (newVal) {
messages () {
const scrollEl = this.$el.querySelector('.chat-window')
if (!scrollEl) return
if (scrollEl.scrollTop + scrollEl.offsetHeight + 20 > scrollEl.scrollHeight) {

View file

@ -109,7 +109,7 @@ export const BUTTONS = [{
status.user.id === currentUser.id &&
PUBLIC_SCOPES.has(status.visibility)
},
action ({ status, dispatch, emit }) {
action ({ status, dispatch }) {
if (status.pinned) {
return dispatch('unpinStatus', { id: status.id })
} else {
@ -130,7 +130,7 @@ export const BUTTONS = [{
? 'status.unbookmark'
: 'status.bookmark',
if: ({ loggedIn }) => loggedIn,
action ({ status, dispatch, emit }) {
action ({ status, dispatch }) {
if (status.bookmarked) {
return dispatch('unbookmark', { id: status.id })
} else {
@ -175,7 +175,7 @@ export const BUTTONS = [{
currentUser.privileges.includes('messages_delete')
)
},
confirm: ({ status, getters }) => getters.mergedConfig.modalOnDelete,
confirm: ({ getters }) => getters.mergedConfig.modalOnDelete,
confirmStrings: {
title: 'status.delete_confirm_title',
body: 'status.delete_confirm',

View file

@ -34,8 +34,8 @@ const StatusPopover = {
return
}
this.$store.dispatch('fetchStatus', this.statusId)
.then(data => (this.error = false))
.catch(e => (this.error = true))
.then(() => (this.error = false))
.catch(() => (this.error = true))
}
}
},

View file

@ -81,7 +81,7 @@ const ThreadTree = {
toggleCurrentProp (name) {
this.toggleStatusContentProperty(this.status.id, name)
},
setCurrentProp (name, newVal) {
setCurrentProp (name) {
this.setStatusContentProperty(this.status.id, name)
}
}

View file

@ -241,7 +241,7 @@ const Timeline = {
// statuses will be nearby statuses before and after it
this.virtualScrollIndex = approxIndex
},
scrollLoad (e) {
scrollLoad () {
const bodyBRect = document.body.getBoundingClientRect()
const height = Math.max(bodyBRect.height, -(bodyBRect.y))
if (this.timeline.loading === false &&

View file

@ -85,7 +85,6 @@ export default {
return this.user.id !== this.$store.state.users.currentUser.id
},
subscribeUrl () {
const serverUrl = new URL(this.user.statusnet_profile_url)
return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus`
},

View file

@ -81,7 +81,7 @@ const UserListMenu = {
const user = this.user
const { id, name } = user
store.state.api.backendInteractor.deleteUser({ user })
.then(e => {
.then(() => {
this.$store.dispatch('markStatusesAsDeleted', status => user.id === status.user.id)
const isProfile = this.$route.name === 'external-user-profile' || this.$route.name === 'user-profile'
const isTargetUser = this.$route.params.name === name || this.$route.params.id === id

View file

@ -24,7 +24,7 @@ const VideoAttachment = {
}
this.$emit('play')
},
onPaused (e) {
onPaused () {
this.$emit('pause')
},
setHasAudio (e) {

View file

@ -15,7 +15,7 @@ const WhoToFollow = {
},
methods: {
showWhoToFollow (reply) {
reply.forEach((i, index) => {
reply.forEach((i) => {
this.$store.state.api.backendInteractor.fetchUser({ id: i.acct })
.then((externalUser) => {
if (!externalUser.error) {

View file

@ -54,7 +54,7 @@ const WhoToFollowPanel = {
}
},
watch: {
user: function (user, oldUser) {
user: function () {
if (this.suggestionsEnabled) {
getWhoToFollow(this)
}
@ -62,7 +62,7 @@ const WhoToFollowPanel = {
},
mounted:
function () {
this.usersToFollow = new Array(3).fill().map(x => (
this.usersToFollow = new Array(3).fill().map(() => (
{
img: this.$store.state.instance.defaultAvatar,
name: '',