Set `operator-linebreak` to `before`

This commit is contained in:
wvffle 2022-07-21 22:36:43 +00:00 committed by Georg Krause
parent 998c7e1c09
commit bd1a92c5f1
12 changed files with 33 additions and 31 deletions

View File

@ -23,6 +23,9 @@ module.exports = {
'vue' 'vue'
], ],
rules: { rules: {
// NOTE: Nicer for the eye
'operator-linebreak': ['error', 'before'],
// NOTE: Handled by typescript // NOTE: Handled by typescript
'no-undef': 'off', 'no-undef': 'off',
'no-unused-vars': 'off', 'no-unused-vars': 'off',

View File

@ -89,9 +89,9 @@ watchEffect(() => {
}) })
const moderationNotifications = computed(() => const moderationNotifications = computed(() =>
store.state.ui.notifications.pendingReviewEdits + store.state.ui.notifications.pendingReviewEdits
store.state.ui.notifications.pendingReviewReports + + store.state.ui.notifications.pendingReviewReports
store.state.ui.notifications.pendingReviewRequests + store.state.ui.notifications.pendingReviewRequests
) )
onMounted(async () => { onMounted(async () => {

View File

@ -252,8 +252,8 @@ export default {
if (!this.$store.state.auth.authenticated) return false if (!this.$store.state.auth.authenticated) return false
// TODO (wvffle): Is it better to compare ids? Is full_username unique? // TODO (wvffle): Is it better to compare ids? Is full_username unique?
return this.obj.created_by.full_username === this.$store.state.auth.fullUsername || return this.obj.created_by.full_username === this.$store.state.auth.fullUsername
this.$store.state.auth.availablePermissions.library || this.$store.state.auth.availablePermissions.library
}, },
previousState () { previousState () {
if (this.obj.is_applied) { if (this.obj.is_applied) {

View File

@ -287,9 +287,9 @@ export default {
canEdit () { canEdit () {
if (!this.$store.state.auth.authenticated) return false if (!this.$store.state.auth.authenticated) return false
const isOwner = this.object.attributed_to && const isOwner = this.object.attributed_to
// TODO (wvffle): Is it better to compare ids? Is full_username unique? // TODO (wvffle): Is it better to compare ids? Is full_username unique?
this.$store.state.auth.fullUsername === this.object.attributed_to.full_username && this.$store.state.auth.fullUsername === this.object.attributed_to.full_username
return isOwner || this.$store.state.auth.availablePermissions.library return isOwner || this.$store.state.auth.availablePermissions.library
}, },

View File

@ -418,11 +418,11 @@ export default {
}, },
processableFiles () { processableFiles () {
return ( return (
this.uploads.pending + this.uploads.pending
this.uploads.skipped + + this.uploads.skipped
this.uploads.errored + + this.uploads.errored
this.uploads.finished + + this.uploads.finished
this.uploadedFilesCount + this.uploadedFilesCount
) )
}, },
processedFilesCount () { processedFilesCount () {

View File

@ -27,11 +27,11 @@ const running = computed(() => {
return false return false
} }
return store.state.radios.current?.type === props.type && return store.state.radios.current?.type === props.type
store.state.radios.current?.customRadioId === props.customRadioId && && store.state.radios.current?.customRadioId === props.customRadioId
( && (
typeof props.objectId === 'string' || typeof props.objectId === 'string'
store.state.radios.current?.objectId?.fullUsername === props.objectId?.fullUsername || store.state.radios.current?.objectId?.fullUsername === props.objectId?.fullUsername
) )
}) })

View File

@ -37,8 +37,8 @@ export default (props: PlayOptionsProps) => {
if (props.track) { if (props.track) {
return props.track.uploads?.length > 0 return props.track.uploads?.length > 0
} else if (props.artist) { } else if (props.artist) {
return props.artist.tracks_count > 0 || return props.artist.tracks_count > 0
props.artist.albums.some((album) => album.is_playable === true) || props.artist?.albums.some((album) => album.is_playable === true)
} else if (props.tracks) { } else if (props.tracks) {
return props.tracks.some((track) => (track.uploads?.length ?? 0) > 0) return props.tracks.some((track) => (track.uploads?.length ?? 0) > 0)
} }

View File

@ -111,8 +111,8 @@ export interface Channel {
itunes_category?: unknown itunes_category?: unknown
itunes_subcategory?: unknown itunes_subcategory?: unknown
language?: string language?: string
owner_name: string owner_name?: string
owner_email: string owner_email?: string
} }
} }

View File

@ -6,9 +6,9 @@ export function truncate (str: string, max = 100, ellipsis = '…', middle = fal
if (!middle) return str.slice(0, max) + ellipsis if (!middle) return str.slice(0, max) + ellipsis
const charsToShow = max - ellipsis.length const charsToShow = max - ellipsis.length
return str.slice(0, Math.ceil(charsToShow / 2)) + return str.slice(0, Math.ceil(charsToShow / 2))
ellipsis + + ellipsis
str.slice(-Math.floor(charsToShow / 2)) + str.slice(-Math.floor(charsToShow / 2))
} }
export function momentFormat (date: Date, format = 'lll') { export function momentFormat (date: Date, format = 'lll') {

View File

@ -34,8 +34,8 @@ const scanProgress = computed(() => Math.min(latestScan.value.processed_files *
const scanStatus = computed(() => latestScan.value?.status ?? 'unknown') const scanStatus = computed(() => latestScan.value?.status ?? 'unknown')
const canLaunchScan = computed(() => scanStatus.value !== 'pending' && scanStatus.value !== 'scanning') const canLaunchScan = computed(() => scanStatus.value !== 'pending' && scanStatus.value !== 'scanning')
const radioPlayable = computed(() => ( const radioPlayable = computed(() => (
(library.value.actor.is_local || scanStatus.value === 'finished') && (library.value.actor.is_local || scanStatus.value === 'finished')
(library.value.privacy_level === 'everyone' || library.value.follow?.approved) && (library.value.privacy_level === 'everyone' || library.value.follow?.approved)
)) ))
const { $pgettext } = useGettext() const { $pgettext } = useGettext()

View File

@ -25,10 +25,10 @@ const object = ref<Library | null>(null)
const isOwner = computed(() => store.state.auth.authenticated && object.value?.actor.full_username === store.state.auth.fullUsername) const isOwner = computed(() => store.state.auth.authenticated && object.value?.actor.full_username === store.state.auth.fullUsername)
const isPlayable = computed(() => (object.value?.uploads_count ?? 0) > 0 && ( const isPlayable = computed(() => (object.value?.uploads_count ?? 0) > 0 && (
isOwner.value || isOwner.value
object.value?.privacy_level === 'everyone' || || object.value?.privacy_level === 'everyone'
(object.value?.privacy_level === 'instance' && store.state.auth.authenticated && object.value.actor.domain === store.getters['instance/domain']) || || (object.value?.privacy_level === 'instance' && store.state.auth.authenticated && object.value.actor.domain === store.getters['instance/domain'])
(store.getters['libraries/follow'](object.value?.uuid) || {}).approved === true || (store.getters['libraries/follow'](object.value?.uuid) || {}).approved === true
)) ))
const { $pgettext } = useGettext() const { $pgettext } = useGettext()

View File

@ -1,7 +1,6 @@
{ {
"extends": "@vue/tsconfig/tsconfig.web.json", "extends": "@vue/tsconfig/tsconfig.web.json",
"compilerOptions": { "compilerOptions": {
"lib": ["webworker"],
"baseUrl": ".", "baseUrl": ".",
"sourceMap": true, "sourceMap": true,
"allowJs": true, "allowJs": true,