biome lint --write

This commit is contained in:
Henry Jameson 2026-01-06 16:20:14 +02:00
commit 8372348148
10 changed files with 27 additions and 27 deletions

View file

@ -57,7 +57,7 @@ const MailerTab = {
const descriptions = this.$store.state.adminSettings.descriptions
const mailerStuff = descriptions[':pleroma']['Pleroma.Emails.Mailer']
const adapterStuff = mailerStuff[':subgroup,' + this.adapter]
return Object.prototype.hasOwnProperty.call(adapterStuff, key)
return Object.hasOwn(adapterStuff, key)
}
}
}

View file

@ -397,7 +397,7 @@ const Status = {
},
tags () {
// eslint-disable-next-line no-prototype-builtins
return this.status.tags.filter(tagObj => tagObj.hasOwnProperty('name')).map(tagObj => tagObj.name).join(' ')
return this.status.tags.filter(tagObj => Object.hasOwn(tagObj, 'name')).map(tagObj => tagObj.name).join(' ')
},
hidePostStats () {
return this.mergedConfig.hidePostStats

View file

@ -109,7 +109,7 @@ export const notifications = {
// Only add a new notification if we don't have one for the same action
// eslint-disable-next-line no-prototype-builtins
if (!state.idStore.hasOwnProperty(notification.id)) {
if (!Object.hasOwn(state.idStore, notification.id)) {
commit('updateNotificationsMinMaxId', notification.id)
commit('addNewNotifications', { notifications: [notification] })

View file

@ -39,9 +39,9 @@ const qvitterStatusType = (status) => {
export const parseUser = (data) => {
const output = {}
const masto = Object.prototype.hasOwnProperty.call(data, 'acct')
const masto = Object.hasOwn(data, 'acct')
// case for users in "mentions" property for statuses in MastoAPI
const mastoShort = masto && !Object.prototype.hasOwnProperty.call(data, 'avatar')
const mastoShort = masto && !Object.hasOwn(data, 'avatar')
output.inLists = null
output.id = String(data.id)
@ -269,7 +269,7 @@ export const parseUser = (data) => {
export const parseAttachment = (data) => {
const output = {}
const masto = !Object.prototype.hasOwnProperty.call(data, 'oembed')
const masto = !Object.hasOwn(data, 'oembed')
if (masto) {
// Not exactly same...
@ -300,7 +300,7 @@ export const parseSource = (data) => {
export const parseStatus = (data) => {
const output = {}
const masto = Object.prototype.hasOwnProperty.call(data, 'account')
const masto = Object.hasOwn(data, 'account')
if (masto) {
output.favorited = data.favourited
@ -432,7 +432,7 @@ export const parseStatus = (data) => {
output.favoritedBy = []
output.rebloggedBy = []
if (Object.prototype.hasOwnProperty.call(data, 'originalStatus')) {
if (Object.hasOwn(data, 'originalStatus')) {
Object.assign(output, data.originalStatus)
}
@ -444,7 +444,7 @@ export const parseNotification = (data) => {
favourite: 'like',
reblog: 'repeat'
}
const masto = !Object.prototype.hasOwnProperty.call(data, 'ntype')
const masto = !Object.hasOwn(data, 'ntype')
const output = {}
if (masto) {

View file

@ -37,7 +37,7 @@ export class RegistrationError extends Error {
if (typeof error === 'string') {
error = JSON.parse(error)
// eslint-disable-next-line
if (error.hasOwnProperty('error')) {
if (Object.hasOwn(error, 'error')) {
error = JSON.parse(error.error)
}
}

View file

@ -254,7 +254,7 @@ export const applyConfig = (input) => {
styleSheet.addRule(`:root { ${rules} }`)
// TODO find a way to make this not apply to theme previews
if (Object.prototype.hasOwnProperty.call(config, 'forcedRoundness')) {
if (Object.hasOwn(config, 'forcedRoundness')) {
styleSheet.addRule(` *:not(.preview-block) {
--roundness: var(--forcedRoundness) !important;
}`)

View file

@ -668,16 +668,16 @@ export const normalizeThemeData = (input) => {
// this might not be even used at all, some leftover of unimplemented code in V2 editor
return generatePreset(input).theme
} else if (
Object.prototype.hasOwnProperty.call(input, '_pleroma_theme_version') ||
Object.prototype.hasOwnProperty.call(input, 'source') ||
Object.prototype.hasOwnProperty.call(input, 'theme')
Object.hasOwn(input, '_pleroma_theme_version') ||
Object.hasOwn(input, 'source') ||
Object.hasOwn(input, 'theme')
) {
// We got passed a full theme file
themeData = input.theme
themeSource = input.source
} else if (
Object.prototype.hasOwnProperty.call(input, 'themeEngineVersion') ||
Object.prototype.hasOwnProperty.call(input, 'colors')
Object.hasOwn(input, 'themeEngineVersion') ||
Object.hasOwn(input, 'colors')
) {
// We got passed a source/snapshot
themeData = input

View file

@ -170,10 +170,10 @@ const _mergeJournal = (...journals) => {
const allJournals = flatten(
journals.map(j => Array.isArray(j) ? j : [])
).filter(entry =>
Object.prototype.hasOwnProperty.call(entry, 'path') &&
Object.prototype.hasOwnProperty.call(entry, 'operation') &&
Object.prototype.hasOwnProperty.call(entry, 'args') &&
Object.prototype.hasOwnProperty.call(entry, 'timestamp')
Object.hasOwn(entry, 'path') &&
Object.hasOwn(entry, 'operation') &&
Object.hasOwn(entry, 'args') &&
Object.hasOwn(entry, 'timestamp')
)
const grouped = groupBy(allJournals, 'path')
const trimmedGrouped = Object.entries(grouped).map(([path, journal]) => {

View file

@ -20,7 +20,7 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
// eslint-disable-next-line no-prototype-builtins
expect(matchedComponents[0].components.default.components.hasOwnProperty('Timeline')).to.eql(true)
expect(Object.hasOwn(matchedComponents[0].components.default.components, 'Timeline')).to.eql(true)
})
it('user\'s profile', async () => {
@ -29,7 +29,7 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
// eslint-disable-next-line no-prototype-builtins
expect(matchedComponents[0].components.default.components.hasOwnProperty('UserCard')).to.eql(true)
expect(Object.hasOwn(matchedComponents[0].components.default.components, 'UserCard')).to.eql(true)
})
it('user\'s profile at /users', async () => {
@ -38,7 +38,7 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
// eslint-disable-next-line no-prototype-builtins
expect(matchedComponents[0].components.default.components.hasOwnProperty('UserCard')).to.eql(true)
expect(Object.hasOwn(matchedComponents[0].components.default.components, 'UserCard')).to.eql(true)
})
it('list view', async () => {
@ -46,7 +46,7 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
expect(Object.prototype.hasOwnProperty.call(matchedComponents[0].components.default.components, 'ListsCard')).to.eql(true)
expect(Object.hasOwn(matchedComponents[0].components.default.components, 'ListsCard')).to.eql(true)
})
it('list timeline', async () => {
@ -54,7 +54,7 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
expect(Object.prototype.hasOwnProperty.call(matchedComponents[0].components.default.components, 'Timeline')).to.eql(true)
expect(Object.hasOwn(matchedComponents[0].components.default.components, 'Timeline')).to.eql(true)
})
it('list edit', async () => {
@ -62,6 +62,6 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
expect(Object.prototype.hasOwnProperty.call(matchedComponents[0].components.default.components, 'BasicUserCard')).to.eql(true)
expect(Object.hasOwn(matchedComponents[0].components.default.components, 'BasicUserCard')).to.eql(true)
})
})

View file

@ -6,7 +6,7 @@ const checkColors = (output) => {
expect(v, key).to.be.an('object')
expect(v, key).to.include.all.keys('r', 'g', 'b')
'rgba'.split('').forEach(k => {
if ((k === 'a' && Object.prototype.hasOwnProperty.call(v, 'a')) || k !== 'a') {
if ((k === 'a' && Object.hasOwn(v, 'a')) || k !== 'a') {
expect(v[k], key + '.' + k).to.be.a('number')
expect(v[k], key + '.' + k).to.be.least(0)
expect(v[k], key + '.' + k).to.be.most(k === 'a' ? 1 : 255)