biome lint --write
This commit is contained in:
parent
b9a77cc61d
commit
8372348148
10 changed files with 27 additions and 27 deletions
|
|
@ -57,7 +57,7 @@ const MailerTab = {
|
||||||
const descriptions = this.$store.state.adminSettings.descriptions
|
const descriptions = this.$store.state.adminSettings.descriptions
|
||||||
const mailerStuff = descriptions[':pleroma']['Pleroma.Emails.Mailer']
|
const mailerStuff = descriptions[':pleroma']['Pleroma.Emails.Mailer']
|
||||||
const adapterStuff = mailerStuff[':subgroup,' + this.adapter]
|
const adapterStuff = mailerStuff[':subgroup,' + this.adapter]
|
||||||
return Object.prototype.hasOwnProperty.call(adapterStuff, key)
|
return Object.hasOwn(adapterStuff, key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -397,7 +397,7 @@ const Status = {
|
||||||
},
|
},
|
||||||
tags () {
|
tags () {
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
// 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 () {
|
hidePostStats () {
|
||||||
return this.mergedConfig.hidePostStats
|
return this.mergedConfig.hidePostStats
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ export const notifications = {
|
||||||
|
|
||||||
// Only add a new notification if we don't have one for the same action
|
// Only add a new notification if we don't have one for the same action
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
// 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('updateNotificationsMinMaxId', notification.id)
|
||||||
commit('addNewNotifications', { notifications: [notification] })
|
commit('addNewNotifications', { notifications: [notification] })
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,9 @@ const qvitterStatusType = (status) => {
|
||||||
|
|
||||||
export const parseUser = (data) => {
|
export const parseUser = (data) => {
|
||||||
const output = {}
|
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
|
// 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.inLists = null
|
||||||
output.id = String(data.id)
|
output.id = String(data.id)
|
||||||
|
|
@ -269,7 +269,7 @@ export const parseUser = (data) => {
|
||||||
|
|
||||||
export const parseAttachment = (data) => {
|
export const parseAttachment = (data) => {
|
||||||
const output = {}
|
const output = {}
|
||||||
const masto = !Object.prototype.hasOwnProperty.call(data, 'oembed')
|
const masto = !Object.hasOwn(data, 'oembed')
|
||||||
|
|
||||||
if (masto) {
|
if (masto) {
|
||||||
// Not exactly same...
|
// Not exactly same...
|
||||||
|
|
@ -300,7 +300,7 @@ export const parseSource = (data) => {
|
||||||
|
|
||||||
export const parseStatus = (data) => {
|
export const parseStatus = (data) => {
|
||||||
const output = {}
|
const output = {}
|
||||||
const masto = Object.prototype.hasOwnProperty.call(data, 'account')
|
const masto = Object.hasOwn(data, 'account')
|
||||||
|
|
||||||
if (masto) {
|
if (masto) {
|
||||||
output.favorited = data.favourited
|
output.favorited = data.favourited
|
||||||
|
|
@ -432,7 +432,7 @@ export const parseStatus = (data) => {
|
||||||
output.favoritedBy = []
|
output.favoritedBy = []
|
||||||
output.rebloggedBy = []
|
output.rebloggedBy = []
|
||||||
|
|
||||||
if (Object.prototype.hasOwnProperty.call(data, 'originalStatus')) {
|
if (Object.hasOwn(data, 'originalStatus')) {
|
||||||
Object.assign(output, data.originalStatus)
|
Object.assign(output, data.originalStatus)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -444,7 +444,7 @@ export const parseNotification = (data) => {
|
||||||
favourite: 'like',
|
favourite: 'like',
|
||||||
reblog: 'repeat'
|
reblog: 'repeat'
|
||||||
}
|
}
|
||||||
const masto = !Object.prototype.hasOwnProperty.call(data, 'ntype')
|
const masto = !Object.hasOwn(data, 'ntype')
|
||||||
const output = {}
|
const output = {}
|
||||||
|
|
||||||
if (masto) {
|
if (masto) {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ export class RegistrationError extends Error {
|
||||||
if (typeof error === 'string') {
|
if (typeof error === 'string') {
|
||||||
error = JSON.parse(error)
|
error = JSON.parse(error)
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
if (error.hasOwnProperty('error')) {
|
if (Object.hasOwn(error, 'error')) {
|
||||||
error = JSON.parse(error.error)
|
error = JSON.parse(error.error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,7 @@ export const applyConfig = (input) => {
|
||||||
styleSheet.addRule(`:root { ${rules} }`)
|
styleSheet.addRule(`:root { ${rules} }`)
|
||||||
|
|
||||||
// TODO find a way to make this not apply to theme previews
|
// 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) {
|
styleSheet.addRule(` *:not(.preview-block) {
|
||||||
--roundness: var(--forcedRoundness) !important;
|
--roundness: var(--forcedRoundness) !important;
|
||||||
}`)
|
}`)
|
||||||
|
|
|
||||||
|
|
@ -668,16 +668,16 @@ export const normalizeThemeData = (input) => {
|
||||||
// this might not be even used at all, some leftover of unimplemented code in V2 editor
|
// this might not be even used at all, some leftover of unimplemented code in V2 editor
|
||||||
return generatePreset(input).theme
|
return generatePreset(input).theme
|
||||||
} else if (
|
} else if (
|
||||||
Object.prototype.hasOwnProperty.call(input, '_pleroma_theme_version') ||
|
Object.hasOwn(input, '_pleroma_theme_version') ||
|
||||||
Object.prototype.hasOwnProperty.call(input, 'source') ||
|
Object.hasOwn(input, 'source') ||
|
||||||
Object.prototype.hasOwnProperty.call(input, 'theme')
|
Object.hasOwn(input, 'theme')
|
||||||
) {
|
) {
|
||||||
// We got passed a full theme file
|
// We got passed a full theme file
|
||||||
themeData = input.theme
|
themeData = input.theme
|
||||||
themeSource = input.source
|
themeSource = input.source
|
||||||
} else if (
|
} else if (
|
||||||
Object.prototype.hasOwnProperty.call(input, 'themeEngineVersion') ||
|
Object.hasOwn(input, 'themeEngineVersion') ||
|
||||||
Object.prototype.hasOwnProperty.call(input, 'colors')
|
Object.hasOwn(input, 'colors')
|
||||||
) {
|
) {
|
||||||
// We got passed a source/snapshot
|
// We got passed a source/snapshot
|
||||||
themeData = input
|
themeData = input
|
||||||
|
|
|
||||||
|
|
@ -170,10 +170,10 @@ const _mergeJournal = (...journals) => {
|
||||||
const allJournals = flatten(
|
const allJournals = flatten(
|
||||||
journals.map(j => Array.isArray(j) ? j : [])
|
journals.map(j => Array.isArray(j) ? j : [])
|
||||||
).filter(entry =>
|
).filter(entry =>
|
||||||
Object.prototype.hasOwnProperty.call(entry, 'path') &&
|
Object.hasOwn(entry, 'path') &&
|
||||||
Object.prototype.hasOwnProperty.call(entry, 'operation') &&
|
Object.hasOwn(entry, 'operation') &&
|
||||||
Object.prototype.hasOwnProperty.call(entry, 'args') &&
|
Object.hasOwn(entry, 'args') &&
|
||||||
Object.prototype.hasOwnProperty.call(entry, 'timestamp')
|
Object.hasOwn(entry, 'timestamp')
|
||||||
)
|
)
|
||||||
const grouped = groupBy(allJournals, 'path')
|
const grouped = groupBy(allJournals, 'path')
|
||||||
const trimmedGrouped = Object.entries(grouped).map(([path, journal]) => {
|
const trimmedGrouped = Object.entries(grouped).map(([path, journal]) => {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ describe('routes', () => {
|
||||||
const matchedComponents = router.currentRoute.value.matched
|
const matchedComponents = router.currentRoute.value.matched
|
||||||
|
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
// 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 () => {
|
it('user\'s profile', async () => {
|
||||||
|
|
@ -29,7 +29,7 @@ describe('routes', () => {
|
||||||
const matchedComponents = router.currentRoute.value.matched
|
const matchedComponents = router.currentRoute.value.matched
|
||||||
|
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
// 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 () => {
|
it('user\'s profile at /users', async () => {
|
||||||
|
|
@ -38,7 +38,7 @@ describe('routes', () => {
|
||||||
const matchedComponents = router.currentRoute.value.matched
|
const matchedComponents = router.currentRoute.value.matched
|
||||||
|
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
// 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 () => {
|
it('list view', async () => {
|
||||||
|
|
@ -46,7 +46,7 @@ describe('routes', () => {
|
||||||
|
|
||||||
const matchedComponents = router.currentRoute.value.matched
|
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 () => {
|
it('list timeline', async () => {
|
||||||
|
|
@ -54,7 +54,7 @@ describe('routes', () => {
|
||||||
|
|
||||||
const matchedComponents = router.currentRoute.value.matched
|
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 () => {
|
it('list edit', async () => {
|
||||||
|
|
@ -62,6 +62,6 @@ describe('routes', () => {
|
||||||
|
|
||||||
const matchedComponents = router.currentRoute.value.matched
|
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)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const checkColors = (output) => {
|
||||||
expect(v, key).to.be.an('object')
|
expect(v, key).to.be.an('object')
|
||||||
expect(v, key).to.include.all.keys('r', 'g', 'b')
|
expect(v, key).to.include.all.keys('r', 'g', 'b')
|
||||||
'rgba'.split('').forEach(k => {
|
'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.a('number')
|
||||||
expect(v[k], key + '.' + k).to.be.least(0)
|
expect(v[k], key + '.' + k).to.be.least(0)
|
||||||
expect(v[k], key + '.' + k).to.be.most(k === 'a' ? 1 : 255)
|
expect(v[k], key + '.' + k).to.be.most(k === 'a' ? 1 : 255)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue